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

Processing bitmaps natively

Android NDK proposes an API dedicated to bitmap processing which allows accessing bitmap surface directly. This API is specific to Android and is not related to the JNI specification. However, bitmaps are Java objects and will need to be treated as such in native code.

To see more concretely how bitmaps can be modified from native code, let's try to decode a camera feed from native code. Android already features a Camera API on the Java side to display a video feed. However, there is absolutely no flexibility on how the feed is displayed—it is drawn directly on a GUI component. To overcome this problem, snapshots can be recorded into a data buffer encoded in a specific format, YUV, which is not compatible with classic ...

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