<!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } A:link { so-language: zxx } -->
1.install JDK 1.5
ubuntu 默认安装 OpenJDK , 我们需要安装sun-java5-jdk.
换用ubuntu 9.04 source.list
sudo apt-get install sun-java5-jdk
确认环境java -version
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02)
Java HotSpot(TM) Client VM (build 1.5.0_19-b02, mixed mode, sharing)
2.install Eclipse
使用ubuntu 9.10 source.list
sudo apt-get install eclipse
//eclipse-pde will install eclipse-jdt
3.install ADT
eclipse help > software updates
add avaliable software > add site
<!-- m -->http://dl-ssl.google.com/android/eclipse <!-- m --> > install
可能会遇到bug ,这个是bug 的解决方案。update 后即可解决。
Bug #482244 in eclipse (Ubuntu): “requires 'org.eclipse.gef 0.0.0' but it could not be found
<!-- m -->http://download.eclipse.org/releases/galileo <!-- m --> to your update sites and try again.
也就是先add http://download.eclipse.org/releases/galileo
再add http://dl-ssl.google.com/android/eclipse <!-- m -->
可以顺利完成安装
4. install Android SDK
download : sdk 1.6
解压缩 sdk
eclipse >windows> prefences > Android > SDK Location : set the path of the sdk1.6
sudo chmod a+w android-sdk-linux_86 -R
windows > Android SDK and AVD Manager > installed Package > update All >accept > installed accepted
windows > Android SDK and AVD Manager > Virtual Devices > New > target AVD
此时SDK 已经安装完成了。
使用open > project >android project > open exist project ....
5.install NDK
解压缩 NDK
install NDK : cd $NDKROOT ./bulid/host-setup.sh
<!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } -->
可能会遇到bug , 1.6NDK 中/host-setup.sh 文件 119 行
if [ "$result" == "Pass" ] ; then
改为 if [ "$result" = "Pass" ] ; then
此时设置好NDK 。
我们可以测试下 NDK 1.6
cd $NDKROOT
make APP=hello-jni
make clean APP=hello-jni
Android NDK: Building for application 'hello-jni'
Clean: hello-jni
asus@ubuntu:/opt/android-ndk-1.6_r1$ make APP=hello-jni
Android NDK: Building for application 'hello-jni'
Compile thumb : hello-jni <= apps/hello-jni/project/jni/hello-jni.c
SharedLibrary : libhello-jni.so
Install : libhello-jni.so => apps/hello-jni/project/libs/armeabi
此时,证明NDK 工作正常。
我们可以使用Eclipse > open > project > android > open exits /android-ndk-1.6_r1/apps/hello-jni
而后 run as > Android Application