Creating our first HelloWorld-JNI

Let´s create a project with Android Studio with a minimal setup. In order to do so, navigate to Project | New | New Project. Create the most minimalistic setup available—typically just a project; do not add Activity from the beginning. This adds a lot of boilerplate code that we do not need at this moment. When the project has been created, add a new Activity by right-clicking on your source folder, and clicking on New | Java Class. Name the class Main Activity:

Creating our first HelloWorld-JNI

When the file has been created, add this very basic code for Activity:

public class MainActivity extends Activity { @Override protected void onCreate(Bundle ...

Get Android High Performance Programming 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.