How to use NDK? Starting with 'hello world' app

user517400 picture user517400 · Jan 24, 2011 · Viewed 40.3k times · Source

I would like to see a 'Hello world' program written in C/C++ but made to run on Android.

I know this is possible by using NDK and JNI calls. But not able to make it work. No guides online are helpful.

Need to know to to get started.

I am developing on Windows 7 machine and also using Eclipse for ease.

Android installation path: C:\Program Files\Android\android-sdk-windows and NDK I have extracted to: C:\Program Files\Android\android-ndk-r5

  1. How do I import NDK to eclipse?
  2. How to use C/C++ in Android?

If I could get help running a simple 'hello world' I can design most of my sensitive code with C++.

Answer

Cristian picture Cristian · Jan 24, 2011

There are samples in the android-ndk-r5 folder + there is a nice step-by-step tutorial:

https://developer.android.com/ndk/samples/index.html

No excuses, dude. You just have to read (take a look at the Exploring the hello-jni Sample section).