336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
요즘 Motorola, LG 에서도 안드로이드 폰을 국내에서 출시하며,
IPhone 대항마의 역할로써 안드로이드 폰이 어느 정도 자리를 잡아가고 있는 것 같습니다.
TV만 보고 있어도 하루에도 여러 번씩 SKT 안드로이드 폰 광고를 볼 수도 있기도 하구요.
때문에 오늘은 안드로이드에 대한 재밌는 상식 하나를 소개할까 합니다.

아시는 분도 계시겠지만, Android 플랫폼의 버젼명은 디저트 종류 음식 이름을 애칭으로 가지고 있습니다.
최초 버젼인 1.5 는 Cupcake(컵케익), 1.6 은 Donut(도넛), 최근의 2.0 버젼이후 2.1까지는 Eclair(이클레어) 라고 불리고 있죠.
2010년 5월경 출시될 다음버젼 이름은 Froyo(프로요 : Frozen Yogurt)가 확정된 상태입니다.


Froyo 의 다음 버젼은 Gingerbread(진저브레드)라는 것도 거의 확정인 상태 이지요.

 

딱 보고 감이 오시나요?

Cupcake
Donut
Eclair
Froyo
Gingerbread

Cupcake 을 시작으로 Android Version 닉네임의 제일 첫 글자는 알파벳 순서로 증가하고 있습니다.
아마 Gingerbread 다음 버젼은 H 로 시작하는 디저트 이름이 닉네임으로 붙게 되겠지요? H 로 시작하는 디저트가 뭐가 있을까요? 
H 로 시작하는 음식 이름도 Hotdog, Hamburger 를 제외하면 딱히 생각이 안나는 군요... ^^
여러분들이 한 번 맞춰 보도록 하세요~

아래는 구글의 PM 인 Ryan Gibson 이 라디오 방송에서 얘기한 Andorid Version 에 대한 이야기 입니다.

Q: How did Android versions come to be named after desserts?
A: We wanted an alphabetical naming scheme that would also provide a fun theme for our small release celebrations.  We considered predatory animals, and stomach viruses but they are a lot less fun to have at a party.

Q: What were the "A" and "B" desserts? Apple crumb? Babka?
A: There actually were no "A" and "B" software updates named after a dessert. It just started with Cupcake.

Q: Who determines the dessert names?
A: It's a collaborative effort from the entire team, company, spouses, Google chefs, random passer-bys and the Android development community all throwing out ideas and recipes.  My office door is festooned with suggestions for the future.  It is very motivational to look up from work and see pictures of tasty treats.

Q: Are the desserts actually served at the Google cafeteria at any point?
A: Absolutely!

Q: Have you determined any desserts past "F"?
A: The discussion is as heated as an oven full of cupcakes  We would like to have a Gingerbread House, but that depends a lot on what happens with the housing market by then. 

 

※ 일반적으로 Phone의 버젼명에 의미 없는 숫자나 날짜를 기반으로 한 버젼명을 사용하는데요. 
힘든 개발 환경속에서의 이런 사소한 잔 재미를 찾고 만들어 실행하는 것이 구글의 창의적인 결과물의 원동력의 일부라고 봐도 되겠지요??

※ 이런식의 작명법은 Ubuntu 의 Project가 원조라고 하네요.



블로그 이미지

By훈트

,
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
Android 에서 EditText 에 문자를 입력하다보면 특정 키에 대한 처리를 하고싶을 때가 있다.
예를 들면,

아이디와 비밀번호 등을 입력한뒤 Enter 키의 입력시 한줄 내려쓰가 된다
이것을 처리하는 코드를 간단하게 작성해봤다.


onKey 이벤트를 catch하여 입력된 keyCodeevent.KEYCODE를 비교하여 해당 key입력 시 특정 처리를 할수 있다.

return true; 대신 구현하고싶은 코드를 작성하면 된다.
블로그 이미지

By훈트

,
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

 

리소스에서 bitmap을 읽어오고 화면에 출력한 후 touch를 이용해서 drag하는 예제

package com.jjihun.bitmaptest;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;

public class BitmapView extends View {
 Bitmap bitmap;
 int width;
 int height;
 int dx;
 int dy;
 public BitmapView(Context context, AttributeSet attrs) {
  super(context, attrs);

  bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.yuandi);
  // 얘 뒤져보면 byte[] 에서 bitmap생성하는 것도 있심

  width = bitmap.getWidth();
  height = bitmap.getHeight();
 }

 @Override
 protected void onDraw(Canvas canvas) {
  canvas.drawBitmap(
     bitmap, // 출력할 bitmap
     new Rect(0,0,width,height),   // 출력할 bitmap의 지정된 영역을 (sub bitmap)
     new Rect(dx,dy,dx+width,dy+height),  // 이 영역에 출력한다. (화면을 벗어나면 clipping됨)
     null);

  super.onDraw(canvas);
 }

 @Override
 public boolean onTouchEvent(MotionEvent event) {
  
  switch(event.getAction()) {
  case MotionEvent.ACTION_DOWN:
   break;
  case MotionEvent.ACTION_UP:
   break;
  case MotionEvent.ACTION_MOVE:
// 주루룩 drag했을 경우 히스토리가 모두 기록되어서 전달됨
   int length=event.getHistorySize();
   float sx, sy, ex, ey;
   
   if (length != 0) {
    sx = event.getHistoricalX(0);
    sy = event.getHistoricalY(0);
    ex = event.getHistoricalX(length-1);
    ey = event.getHistoricalY(length-1);

    dx += (int)(ex-sx);
    dy += (int)(ey-sy);
   }
   invalidate();
   break;
  }
  
  return true;
 }
}


블로그 이미지

By훈트

,