To reach its full potential, JNI allows calling back Java code from C/C++. "Back" because native code is first invoked from Java, which in turn calls it back. Such calls are performed through a reflective API, which allows doing almost anything that can be done directly in Java.
Another important matter to consider with JNI is threading. Native code can be run on a Java thread, managed by the Dalvik VM, and also from a native thread created with standard POSIX primitives. Obviously, a native thread cannot call JNI code unless it is turned into a managed Java thread! Programming with JNI necessitates knowledge of all these subtleties. This chapter will guide you through the main ones.
The last topic, which is specific to Android and not JNI, other: the Android-specific Bitmap API aims at giving full processing power to graphics applications running on these tiny (but powerful) devices.
The Android NDK also proposes a new API to access natively...
Android NDK: Beginner's Guide
By :
Android NDK: Beginner's Guide
By:
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
Free Chapter
Setting Up Your Environment
Starting a Native Android Project
Interfacing Java and C/C++ with JNI
Calling Java Back from Native Code
Writing a Fully Native Application
Rendering Graphics with OpenGL ES
Playing Sound with OpenSL ES
Handling Input Devices and Sensors
Porting Existing Libraries to Android
Intensive Computing with RenderScript
Afterword
Index
Customer Reviews