O'Reilly logo

Android NDK Beginner's Guide by Sylvain Ratabouil

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

Summary

We have seen more in-depth how to make Java and C/C++ communicate together. Android is now fully bilingual! Java can call C/C++ code with any type of data or object and native code can call Java back. We have discovered, in more detail, how to attach and detach a thread to the VM and synchronize Java and native threads together with JNI monitors. Then we saw how to call Java code from native code with the JNI Reflection API. Practically any Java operation can be performed from native code thanks to it. However, for best performance, class, method, or fields descriptor must be cached. Finally, we have processed bitmaps natively thanks to JNI and decoded a video feed manually. But an expensive conversion is needed from default YUV format ...

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