Book Image

Android NDK: Beginner's Guide

By : Sylvain Ratabouil
Book Image

Android NDK: Beginner's Guide

By: Sylvain Ratabouil

Overview of this book

Table of Contents (18 chapters)
Android NDK Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Calling Java back from native code


In the previous chapter, we discovered how to get a Java class descriptor with the JNI method FindClass(). However, we can get much more! Actually, if you are a regular Java developer, this should remind you of something: the Java Reflection API. JNI is similar in that it can modify Java object fields, run Java methods, and access static members, but from native code!

For this last part with the Store project, let's enhance our store application so that it notifies Java when an entry has been successfully inserted.

Note

The resulting project is provided with this book under the name Store_Part10.