Android Native Components

When a computationally intensive function is critical to an Android application, it might be worthwhile to move the intensive computation to native C or C++ for efficiency. The Android NDK exists to help in the development of a native component.The NDK is a companion to the Android Software Development Kit (SDK) and includes a bundle of libraries that can be used to build C/C++ libraries. Steps to set up and build an Android native component are

1. Download the Android NDK from http://developer.android.com/sdk/ndk/, which includes detailed documents on usage.

2. Create an Android project through the normal means under the NDK directory.

3. Create a jni/ folder under the project created in step 2.

4. Create the necessary C/C++ program files under the jni/ folder.

5. Create an Android.mk make file.

6. Run the build script (ndk-build for NDK-r4) from the project directory.

7. Inside the Android Java project, import the library and call the native functions.

Using the Eclipse Integrated Development Environment (IDE), the native libraries are properly bundled with the application upon build.

Character Building Thought Power

Character Building Thought Power

Character-Building Thought Power by Ralph Waldo Trine. Ralph draws a distinct line between bad and good habits. In this book, every effort is made by the writer to explain what comprises good habits and why every one needs it early in life. It draws the conclusion that habits nurtured in early life concretize into impulses in future for the good or bad of the subject.

Get My Free Ebook


Post a comment