- slide 2 of 2
Use native code!
Many users asked for the possibility to use Android applications in their native language. Now you have the chance to do this. All you need to do is to go to the Android developer site and download the Android Native Development Kit.
Learn about the main advantages of NDK!
NDK provides you with native code libraries from C and C++ sources. These libraries will be transformed into packages files. You will also be able to access the Android 1.5 documentation, samples and tutorials.
Get stable headers!
Android 1.5 provides stable headers for some applications like the standard C library, the standard math library, the JNI interface.
Learn to balance the benefits against the disadvantages!
As a developer you will need to learn how to balance the benefits of using NDK against the disadvantages. First of all keep in mind that NDK can’t be applied to all of the available Android applications.
Another thing a developer should be aware of is that by using NDK the application will become more complicated and harder to debug. You will have no access to framework APIs. To increase performance you can use for some applications CPU-intensive operations.
Make sure you read the documentation!
Read the documentation and you will find a lot of useful information about how to create shared libraries for your Android application. Remember that you can find the documentation only in the downloadable NDK package.
You will also learn about issues in the Android system images that you should keep in mind if you are developing using the NDK.
In the documentation you can read information about NDK development. Take your time to learn about NDK and you will be able to take advantage of all the benefits that you can get!
To access the overview of the ‘’bionic’’ C library all you have to do is to read the OVERVIEW.TXT.
Check the two sample Android applications!
To understand better how to use native code in your Android applications you should check these two sample Android.
The application hello-JNI allows you to load a string from a native method to display it in the application.
You will also be able to load a shared library in a native method with the application two-LIBS.