Book Image

Android NDK: Beginner's Guide

By : Sylvain Ratabouil
Book Image

Android NDK: Beginner's Guide

By: Sylvain Ratabouil

Overview of this book

Table of Contents (18 chapters)
Android NDK Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – creating a native Android project


Gradle-based projects can be created easily through Android Studio:

  1. Launch Android Studio. On the welcome screen, select New Project… (or go to File | New Project… if a project is already opened).

  2. From the New Project wizard, enter the following configuration and click on Next:

  3. Then, select the minimum SDK (for example, API 14: Ice Scream Sandwich) and click on Next.

  4. Select Blank Activity with Fragment and click on Next.

  5. Finally, enter Activity Name and Layout Name names as follows and click on Finish:

  6. Android Studio should then open the project:

  7. Modify StoreActivity.java and create Store.java in the same way as we did in the Interfacing Java with C/C++ section in this chapter (Step 1 and 2).

  8. Create the app/src/main/jni directory. Copy the C and Header files we created in the Interfacing Java with C/C++ section in this chapter (Step 4 and 5).

  9. Edit app/build.gradle that has been generated by Android Studio. In defaultConfig, insert a ndk section...