Time for action – creating a basic native Activity

We are now going to see how to create a minimal native activity that runs an event loop.

  1. Create a new hybrid Java/C++ project, as shown in Chapter 2, Starting a Native Android Project.
    • Name it DroidBlaster.
    • Turn the project into a native project, as already seen in the previous chapter. Name the native module droidblaster.
    • Remove the native source and header files that have been created by ADT.
    • Remove the reference to the Java src directory in Project Properties | Java Build Path | Source. Then, remove the directory itself on disk.
    • Get rid of all layouts in the res/layout directory.
    • Get rid of jni/droidblaster.cpp if it has been created.
  2. In AndroidManifest.xml, use Theme.NoTitleBar.Fullscreen as the application ...

Get Android NDK Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.