Using your own handmade makefiles with Gradle is a bit tricky but not too complicated:
Copy the
Android.mk
andApplication.mk
files we created in the Interfacing Java with C/C++ section in this chapter into theapp/src/main/jni
directory.Edit
app/build.gradle
.Add an import for the
OS
"Class" and remove the firstndk
section we created in the previous section:import org.apache.tools.ant.taskdefs.condition.Os apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.packtpub.store" minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }
Still in the android section of
app/build.gradle
., insert asourceSets.main
section...