Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to build / compile ndk application?

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
# 
like image 475
RBJ Avatar asked Feb 03 '23 22:02

RBJ


2 Answers

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.

like image 120
Harry Joy Avatar answered Feb 06 '23 15:02

Harry Joy


  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 enter image description here

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

ndk-build 

enter image description here

  1. Run the application in emulator to see results enter image description here
like image 29
Altanai Avatar answered Feb 06 '23 14:02

Altanai