Time for action – decoding camera feed from native code
- Create a new hybrid Java/C++ project like shown in Chapter 2, Creating, Compiling, and Deploying Native Projects:
- Name it
- Its main package is
- Its main activity is
- Get rid of
res/main.xml as we will not create a GUI this time.
- Do not forget to create a
jni directory at project's root.
- In the application manifest, set the activity style to fullscreen and its orientation to landscape. Landscape orientation avoids most camera orientation problems that can be met on Android devices. Also request acces permission to the Android camera:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.packtpub" ...
Get Android NDK Beginner's Guide now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.