Implement C/ C++ Lib using ANDROID NDK on Android

Android uses Java as it’s native programming language. The developers should use Java to develop Android app. Unfortunately, in some case developers can’t use Java to develop. For example : to communicate with network protocol interface/ radio interface, developers better use C/ C++ library or write an Android program using C/ C++. In order to make it works, we will use Android NDK.
“The NDK is a toolset that allows you to implement parts of your app using native-code languages such as C and C++. For certain types of apps, this can be helpful so you can reuse existing code libraries written in these languages, but most apps do not need the Android NDK (taken from developers.android.com)”. Here is the steps how to do that.
1. Download Android NDK here : https://developer.android.com/tools/sdk/ndk/index.html
2. After download Android NDK, I got following file android-ndk-r10c-windows-x86_64.exe
3. Move the file into sdk directory of your Android Studio Installer

4. Just click the file, it will extract it self.
5. After self extraction successful, we will have file and directory like following

6. Create simple project using Eclipse ADT or Android Studio like following.



7. Create a directory called ‘jni’ within the root application. Like following

Jni ==> java native interface
8. Within jni directory, create a file called jni.h ( this file contains header ) and type following.
===> continue

Tagged: , , , ,

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: