how to build / compile ndk application?

大城市里の小女人 提交于 2020-02-01 18:31:08

问题


hi now i am download ndk but i dont know how to build and compile actually i am new for android application....now i am using linux...and i am not well in command line....

embdes@embdes-laptop:~$ cd /home/embdes/projects/android/android-sdk-linux_86
/platform-tools/
embdes@embdes-laptop:~/projects/android/android-sdk-linux_86/platform-tools$ 
./adb shell 
# ls
config
cache
sdcard
acct
mnt
d
etc
system
sys
sbin
proc
init.rc
init.goldfish.rc
init
default.prop
data
root
dev
# cd /sdcard
# ls
LOST.DIR
unnai.mp3
car.3gp
DCIM
cheetah-.3gp
funny.3gp
tshirt.3gp
Girl.3gp
dancing.3gp
b7.jpeg
girl1.3gp
tv.3gp
sports.3gp
sports1.3gp
sports3.3gp
sport2.3gp
tv.jpeg
tv1.jpeg
global.jpeg
orange.jpeg
images.jpeg
ddddd.jpeg
balloons-lift-car.3gp
3d-little-monster.3gp
smoking.3gp
the.3gp
NO$GBA.2.6a.zip
worldreborn.bin
# 

回答1:


Read getting started here: http://developer.android.com/sdk/ndk/index.html

also look at samples they explained here: http://developer.android.com/sdk/ndk/overview.html#samples

Here: android/ndk-tutorial/ you will find a tutorial on working with NDK in android.

TO use NDK with eclipse look at here: eclipse-and-android-ndk

Hope this helps.




回答2:


  1. Download and install ndk

    You can install Ndk from https://developer.android.com/ndk/downloads/index.html At the time of writing ndk-r10e was the latest version and i was on linux 64 bits so i downloaded this - android-ndk-r10e-linux-x86_64.bin

2 after downloading you need to install it

change the permissions

chmod a+x android-ndk-r10e-linux-x86_64.bin

execute

./android-ndk-r10e-linux-x86_64.bin

3 add it to path on linux

export PATH=$PATH:/home/android-ndk-r10e
  1. To run a sample application use hello-jni under samples

5.goto the project location from terminal and ndk-build

ndk-build 

  1. Run the application in emulator to see results


来源:https://stackoverflow.com/questions/4849565/how-to-build-compile-ndk-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!