參考:http://www.linuxidc.com/Linux/2011-07/39582.htm
一.環境搭建
1. Java 下載安裝:
->jdk-6u25-linux-i586.bin
url: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html
-> 1、jdk-1_5_0_06-linux-i586.bin下載到/usr/soft,賦予可執行權限:chmod 755 jdk-1_5_0_06-linux-i586.bin
2、執行:./jdk-6u25-linux-i586.bin 空格鍵翻頁,到最後輸入yes
3、配置環境變量:在/etc/profile 中加入:
export PATH=/usr/soft/jdk*.*/bin:$PATH
exportJAVA_HOME=/usr/soft/jdk*.*.*
4、運行:source /etc/profile 使配置文件生效
5、運行:java -version,顯示jdk版本,jdk安裝成功
->linux操作系統可能默認會安裝有openjdk
需要將自己安裝的Java設置為默認的:
sudoupdate-alternatives --install /usr/bin/java java /usr/local/jdk1.6.0_26/bin/java1160
2. git GIT 是用於 Linux 開發的版本控制工具
-> unbutu 11.04 安裝:
sudo apt-get install git git-core
3. Android SDK
->http://developer.android.com/sdk/index.html
->解壓下載的SDK文件 到 <Android_SDK_Path>
例如:/usr/local/bin/android-sdk-linux_x86-1.5_r2
->修改/etc/profile 文件
->export PATH=${PATH}:<Android_SDK_Path>/tools
例如:export PATH=${PATH}:<SDK_Path>/
android-sdk-linux_x86-1.5_r2/tools
->save
->restart
->輸入: sudoandroid
->通過彈出界面配置SDK(此時的SDK並未安裝完成,需要通過網絡完成全部安裝)。
->在Settings 處勾選 force https://......
->在AvailablePackages 處 勾選要安裝的包
->Install Selectted 進行安裝
->android avd配置信息的生成
->android avd的創建格式為:androidcreate avd -n your-avd-name -t your-targets
->其中: -n的參數為我們要創建的avd的名字;
-t的參數為Available Android targets的id,
我們可以使用命令:android list查尋其具體信息。
->$android list
AvailableAndroid 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
.....................
->創建avd:$android create avd -n android1.5 -t 2
Android1.5 is a basic Android platform.
Doyou wish to create a custom hardware profile [no]yes
Deviceram size: The amount of physical RAM on the device, in megabytes.
hw.ramSize[96]:128
Touch-screensupport: Whether there is a touch screen or not on the device.
hw.touchScreen[yes]:yes
Track-ballsupport: Whether there is a trackball on the device.
hw.trackBall[yes]:yes
Keyboardsupport: Whether the device has a QWERTY keyboard.
hw.keyboard[yes]:yes
DPadsupport: Whether the device has DPad keys
hw.dPad[yes]:yes
GSMmodem support: Whether there is a GSM modem in the device.
hw.gsmModem[yes]:yes
Camerasupport: Whether the device has a camera.
hw.camera[no]:
Camerasupport: Whether the device has a camera.
hw.camera[no]:yes
Maximumhorizontal camera pixels
hw.camera.maxHorizontalPixels[640]:854
Maximumvertical camera pixels
hw.camera.maxVerticalPixels[480]:480
GPSsupport: 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
Audiorecording support: Whether the device can record audio
hw.audioInput[yes]:yes
Audioplayback support: Whether the device can play audio
hw.audioOutput[yes]:yes
SDCard support: Whether the device supports insertion/removal of virtual SDCards.
hw.sdCard [yes]:yes
Cachepartition support: Whether we use a /cache partition on the device.
disk.cachePartition[yes]:yes
Cachepartition size
disk.cachePartition.size[66MB]:100MB
CreatedAVD ''android-sdk-15'' based on Android 1.5
->啟動模擬器界面: $emulator @android-sdk-15-show-kernel
->配置eclipse,使之支持android sdk(安裝ADT插件):
Eclipse,Help->SoftwareUpdates->Available Software(根據提示進行相應操作)
4. Android NDK
->http://developer.android.com/sdk/ndk/index.html
->解壓NDK包到指定目錄
->配置PATH
->修改/etc/profile 文件
-> NDKROOT=/usr/local/bin/android-ndk-r5c (用戶根據自己的實際安裝配置)
PATH=$PATH:$NDKROOT
->save
->restart
->測試環境變量:
->cd /usr/local/bin/android-ndk-r5c/samples/hello-jni
->ndk-build
->將看到系統會編譯出libhello-jni.so
5. 安裝necessitas
http://sourceforge.net/projects/necessitas/files/
(包括Qt的庫,Qt Createrfor Android, 同時可以選擇安裝NDK 和SDK(但是由於網速問題建議不要選擇可以自己安裝)):
->下載necessitas-0.2-online-sdk-installer-linux
->使用 chmod 添加可執行權限
->安裝過程需要網絡環境
6. Ministro
需要在android上安裝Ministro service
url: http://sourceforge.net/projects/ministro.necessitas.p/files/