Pages

Get it free, Try now

Free Cell Phones

Tuesday, October 5, 2010

Integrate Android NDK with Eclipse

Its assume that both NDK and cygwin are installed on same location

C:\cygwin
C:\android-ndk-r4b

we will use hello-jni project from the samples provided with NDK,
C:\android-ndk-r4b\samples\hello-jni

Import the project inside Eclipse
Click project properties.
Select "builders" from the left-hand list.
Click on button "New..." on the right side.
Select "Program" as the configuration type.
Name it as you like say "Build_JNI"
In 'Main' tab enter
Location as -

c:\cygwin\bin\bash.exe



Working Directory as -

c:\cygwin\bin



Arguments as


--login -c "cd /cygdrive/c/android-ndk-r4b/samples/hello-jni && ndk-build -B"




Make sure you have the two hyphens before login and the quotes after the hyphen-c

Now go to the 'Refresh' tab
Check "Refresh resources upon completion"
Select "Specific resources"
Click on the "Specify resources" button and select your project's lib directory.
Check "Recursively include sub-folders"

Now go to the 'Build Options' tab

Check "Allocate Console"
Check "Launch in background"
Check "Run the builder After a Clean"
Check "Run the builder During manual builds"
Check "Run the builder During auto builds"
Check "Specify working set of relevant resources"
Click on "Specify Resources"
Select your project's JNI directory and all files within.


finally click Apply n OK

Check slide show for LAF
[slideshow]

2 comments:

  1. Dear Basha, nice to see you contributing Andriod stuff.. hay i need Andriod OS which can runs on HTC HD can u get me. Mushtaq. (Guntakal)

    ReplyDelete
  2. Hi,
    If you want to port Android to HTC HD (I guess its WinMo) then follow

    here: http://www.androidonhtc.com/

    ReplyDelete