O'Reilly logo

Pro Android Apps Performance Optimization by Hervé Guihot

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Native Activity

So far, we have seen how to mix Java and C/C++ in a single application. Android 2.3 goes one step further and defines the NativeActivity class, which allows you to write the whole application in C/C++ but does not force you to, as you still have access to the whole Android Java framework through JNI.

NOTE: You do not have to use NativeActivity for all activities in your application. For example, you could write an application with two activities: one NativeActivity and one ListActivity.

If you prefer to read source files or header files in lieu of more formal documentation, you are in for a treat. In fact, most of the documentation is contained in the header files, which you can find in the NDK's platforms/android-9/arch-arm/usr/include/android ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required