2009-12-11 09:27
Android开发,在 ubuntu 9.10 I386 上安装SDK ,NDK。
目标:ubuntu 9.10 上配置 Eclipse 可以调试 Android SDK , NDK
需要软件:
Linux ubuntu 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux
Eclipse 3.5.1
android-ndk-1.6_r1-linux-x86.zip
android-sdk_r04-linux_86.tgz
ADT 0.95
JDK 1.5 (官方建议1.5版本)
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
http://dl-ssl.google.com/android/eclipse > install
可能会遇到bug ,这个是bug的解决方案。update 后即可解决。
Bug #482244 in eclipse (Ubuntu): “requires 'org.eclipse.gef 0.0.0' but it could not be found
http://download.eclipse.org/releases/galileo to your update sites and try again.
也就是先add http://download.eclipse.org/releases/galileo
再add http://dl-ssl.google.com/android/eclipse
可以顺利完成安装
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
可能会遇到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
(责任编辑:IT) |