Home > Android-NDK > Integrate Android NDK with Eclipse

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

Advertisements
Categories: Android-NDK
  1. October 12, 2010 at 12:47 pm

    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)

  2. October 12, 2010 at 2:42 pm

    Hi, If you want to port Android to HTC HD (I guess its WinMo) then follow here: http://www.androidonhtc.com/

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: