Gradle-based projects can be created easily through Android Studio:
Launch Android Studio. On the welcome screen, select New Project… (or go to File | New Project… if a project is already opened).
From the New Project wizard, enter the following configuration and click on Next:
Then, select the minimum SDK (for example, API 14: Ice Scream Sandwich) and click on Next.
Finally, enter Activity Name and Layout Name names as follows and click on Finish:
Android Studio should then open the project:
Modify
StoreActivity.java
and createStore.java
in the same way as we did in the Interfacing Java with C/C++ section in this chapter (Step 1 and 2).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).Edit
app/build.gradle
that has been generated by Android Studio. IndefaultConfig
, insert andk
section...