Time for action – creating a Java UI

Let's create a new Java project with a JNI module.

  1. Create a new hybrid Java/C++ project as shown in Chapter 2, Starting a Native Android Project:
    • Name it RenderScript.
    • The main package is com.packtpub.renderscript.
    • minSdkVersion is 9 and targetSdkVersion is 19.
    • Define the android.permission.WRITE_EXTERNAL_STORAGE permission in the AndroidManifest.xml file.
    • Turn the project into a native project as already seen.
    • Remove the native source and header files that have been created by ADT.
    • Name the main Activity RenderScriptActivity and its layout activity_renderscript.xml.
  2. Define the project.properties file as follows. These lines activate the RenderScript support library, which allows porting code to older devices until ...

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.