ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [android] SDK 1.5 업데이트
    기술 관련/Android 2009. 4. 29. 02:29
    얼마전에 SDK 1.1을 받아 사용하다가 Vista에서 이상하게 동작하는 것을 확인하다보니 SDK 1.5가 따끈 따끈하게 업데이트 되었다. 덕분에 Eclipse Plug-In도 같이 업데이트를 해야 하는데 기존 1.1과 달라진 부분이 있었다. 이에 따라 몇 가지 작업을 해 주어야 정상 동작한다.


    우선 기존 1.1 에서 프로젝트를 작업한 경우 Project Property를 몇 가지 설정을 해 주어야 한다.

    1. 각 프로젝트 별로 Properties 항목을 연다. (Package Explorer 에서 프로젝트를 선택 후 오른쪽 마우스 클릭)
    2. Android 탭을 선택하여 Project Build Target을 선택한다. (기존 프로젝트 호환성을 위해 Anroid 1.1로 선택한다)
    3. Java Build Path 탭을 선택하여 Order And Export를 선택한다.
    4. Android 1.1 Library 앞에 checkbox를 활성화 한다.

    이렇게 설정하면 Project Build는 정상 실행된다. 그러나 Emulator 를 실행해 보면 다음과 같은 에러 메시지가 출력되면서 실행이 되지 않는다.

    Failed to find an AVD compatible with target 'Android 1.1'. Launch aborted.

    즉, Project로 설정한 Android 1.1 target에 대응하는 AVD가 없다는 이야기다. SDK 1.5에서 Emulator를 사용하려면 사용자가 직접 AVD를 생성해 주어야 한다. AVD를 설정할 때는 Command line으로만 관리가 되므로 Console에서 다음과 같이 입력한다.

    $ cd $SDK1.5_HOME/tools/
    $ ./android create avd -n mydroid_1.5 -t 2

    AVD를 1.5로 생성한 이유는 기존 Application도 호환되기 때문에 궂이 1.1 용으로 생성하지는 않았다. 필요하면 1.1용으로 생성해서 사용하면 된다.

    android batch 파일을 실행하면 다음과 같이 avd를 Custom Device로 Configuration을 생성할지 여부를 물어본다.

    $ ./android create avd -n mydroid_1.5 -t 2
    Android 1.5 is a basic Android platform.
    Do you wish to create a custom hardware profile [no]


    일반적인 경우면 그냥 Enter를 입력하면 기본 값으로 생성이 되고 "yes"로 입력 할 경우 다음과 같이 customize 할 수 있다.

    Do you wish to create a custom hardware profile [no]yes

    Device ram size: The amount of physical RAM on the device, in megabytes.
    hw.ramSize [96]:

    Touch-screen support: Whether there is a touch screen or not on the device.
    hw.touchScreen [yes]:

    Track-ball support: Whether there is a trackball on the device.
    hw.trackBall [yes]:

    Keyboard support: Whether the device has a QWERTY keyboard.
    hw.keyboard [yes]:

    DPad support: Whether the device has DPad keys
    hw.dPad [yes]:

    GSM modem support: Whether there is a GSM modem in the device.
    hw.gsmModem [yes]:

    Camera support: Whether the device has a camera.
    hw.camera [no]:yes

    Maximum horizontal camera pixels
    hw.camera.maxHorizontalPixels [640]:320

    Maximum vertical camera pixels
    hw.camera.maxVerticalPixels [480]:240

    GPS support: Whether there is a GPS in the device.
    hw.gps [yes]:

    Battery support: Whether the device can run on a battery.
    hw.battery [yes]:

    Accelerometer: Whether there is an accelerometer in the device.
    hw.accelerometer [yes]:

    Audio recording support: Whether the device can record audio
    hw.audioInput [yes]:

    Audio playback support: Whether the device can play audio
    hw.audioOutput [yes]:

    SD Card support: Whether the device supports insertion/removal of virtual SD Cards.
    hw.sdCard [yes]:

    Cache partition support: Whether we use a /cache partition on the device.
    disk.cachePartition [yes]:

    Cache partition size
    disk.cachePartition.size [66MB]:

    Created AVD 'mydroid_1.5' based on Android 1.5

    $


    Device에 카메라 지원에 대한 항목을 enable 한 것으로 해상도는 240 x 320으로 설정했다.

    AVD에 대한 내용은 Android Tools Docuement (http://developer.android.com/guide/developing/tools/avd.html)에 자세히 나와 있으니 필요에 따라서 환경 설정을 하면 된다.

    이제 Android Emulator를 실행해 보면 다음과 같은 메시지를 볼 수 있다.

    Automatic Target Mode: launching new emulator with compatible AVD 'mydroid_1.5'

    그리고 실행된 Emulator의 Title을 확인 해 보면 `mydroid_1.5'를 사용하고 있음을 볼 수 있다.


    댓글

Designed by Tistory.