![]() |
[3-1] Selecting packages to install |
> brew install android-sdk
2. initialization about Android SDK and AVD.
> android
3. setup the SDK and AVD management.
3-1. switch to "Available" page to select packages you want to install, click button:"install selected"
3-2. switch to "Installed" page to update packages by click button:"Update All..."
![]() |
[3-3] new AVD window |
3-3. To create a new AVD(Android Virtual Devices): switching to "Virtual Devices" page and clicking button:"new".
(Picture - [3-3] "Virtual devices" page)
On the popped window, we could decide what properties of AVD we want. Select your target carefully, and, remember which target version you select.
(Picture - [3-3] new AVD window)
After clicking button:"Create AVD", this AVD will be showed on the AVD list. now, select a AVD you want to run and click button:"start". There will pop a "Launch Option" window, you could just clicking the button:"Launch".
(Picture - [3-3] "Virtual devices" page)
4. After Init. of Android opening, you could see a nice look.
5. Create hello world project via native example.
Do NOT close the AVD. switch to console:
> android create project --package com.example.helloandroid --activity HelloAndroid --target target id --path project-path
Hint: the target id have to be matched with the AVD that we are running. To query the id of target:
> android list targets
for example, the target name of my AVD is Android 2.2, and, in the result of query, I could find out that "id: 4" matches what I need.
...skipped..now, my creating command will be
id: 4 or "android-8"
Name: Android 2.2
Type: Platform
API level: 8
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854
...skipped..
> android create project --package com.example.helloandroid --activity HelloAndroid --target 4 --path ~/haha
6. compiling and installing
> cd where-your-project-is
> ant install
wait a few seconds, you should see something like
...skipped...
BUILD SUCCESSFUL
Total time: 9 seconds
7. switch to AVD, you will find out the HelloAndroid app:
竟然寫了兩個小時.. 囧>
godfat大大, 夠詳細了..吧? XD