android sdk 1.5 安裝與配置

原帖地址:http://blog.mcuol.com/User/weishuangbo/article/13320_1.htm

 

1.下載android sdk
下載地址如下:
http://dl.google.com/android/android-sdk-windows-1.5_r2.zip
http://dl.google.com/android/android-sdk-linux_x86-1.5_r2.zip
2.下載eclipse 3.4.2
 按官方文檔說,android sdk 可以運行在eclipse 3.3以上的IDE中,ubuntu源中的eclipse版本過低,建議使用eclipse 3.4.2,其下載地址爲:
http://download.actuatechina.com/eclipse/eclipse/downloads/drops/R-3.4.2-200902111700/eclipse-SDK-3.4.2-linux-gtk.tar.gz
3.安裝eclipse 3.4.2
先將eclipse解壓:
$tar xzvf eclipse-SDK-3.4.2-linux-gtk.tar.gz
 將解壓出的eclipse文件夾移動到目標目錄中去,在這裏我設定的安裝目標爲:/usr/local下。
$sudo mv eclipse /usr/local/
4.安裝android sdk
解壓android sdk包:
$unzip android-sdk-linux_x86-1.5_r2.zip
移動到目標目錄:<在這裏我將解壓出的sdk文件夾目錄改成了android-sdk>
$mv android-sdk-linux_x86-1.5_r2 android-sdk
$sudo mv android-sdk /usr/local/
5.配置環境變量:
修改~/.bashrc文件,加入android sdk與eclipse的環境變量。
$vi ~/.bashrc
在文件的最後加入
export PATH=/usr/local/android-sdk/tools:/usr/local/eclipse:$PATH
保存並退出vi
使配置信息生效
$source ~/.bashrc
6.android avd配置信息的生成
android avd的創建格式爲:android create avd -n your-avd-name -t your-targets
其中:-n的參數爲我們要創建的avd的名字;-t的參數爲Available Android targets的id,我們可以使用命令:android list查尋其具體信息。
$android list

Available Android targets:
id: 1
     Name: Android 1.1
     Type: Platform
     API level: 2
     Skins: HVGA-P, HVGA (default), QVGA-P, HVGA-L, QVGA-L
id: 2
     Name: Android 1.5
     Type: Platform
     API level: 3
     Skins: HVGA-P, HVGA (default), QVGA-P, HVGA-L, QVGA-L
id: 3
     Name: Google APIs
     Type: Add-On
     Vendor: Google Inc.
     Description: Android + Google APIs
     Based on Android 1.5 (API level 3)
     Libraries:
      * com.google.android.maps (maps.jar)
          API for Google Maps
     Skins: QVGA-P, HVGA-L, HVGA (default), QVGA-L, HVGA-P
Available Android Virtual Devices:


下面我們就以創建一個android 1.5的avd爲例:

$android create avd -n android-sdk-15 -t 2

Android 1.5 is a basic Android platform.
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]:128

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Created AVD ''android-sdk-15'' based on Android 1.5

這樣我們就創建了一個基於1.5的avd,上面的具體意思我想大家都能看懂,就不多說了。下在我們就可以測試一下android emulator了:

$emulator @android-sdk-15 -show-kernel

這樣就可以啓動android emulator了:

加入參數-show-kernel是爲了在終端上打印android kernel的信息。

下面我們配置eclipse,使之支持android sdk:

打開Eclipse,Help->Software Updates->Available Software,點擊
Add site,輸入
http://dl-ssl.google.com/android/eclipse/

然後安裝。完成後就可以開始在eclipse上建立android應用程序了。

 

 

 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章