Manipulating classes in JNI
The previous recipe discusses that Android JNI supports three different kinds of references. The references are used to access the reference data types, including string, class, instance object, and array. This recipe focuses on class manipulations in Android JNI.
Getting ready
The Managing References in NDK recipe should be read first before going through this recipe.
How to do it…
The following steps describe how to build a sample Android application that illustrates class manipulation in JNI:
- Create a project named
ClassManipulation
. Set the package name ascookbook.chapter2
. Create an activity namedClassManipulationActivity
. Under the project, create a folder namedjni
. Refer to the Loading native libraries and registering ...
Get Android Native Development Kit Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.