I google ndk + android studio,and get lots of infomation about how progragming ndk with android studio
Lots of tutorial said that need to put Android.mk and Appliction.mk in jni folder
Now I used Android Stuiod 1.4,and get an excited usage,we don’t need to put above files(Android.mk and Appliction.mk ),just follow below steps ,Android Studio can start programing ndk
1.Download NDK
First you need to download NDK https://developer.android.com/ndk/downloads/index.html
(I suppose you’ve installed Android Studio)
2.Define NDK loction
File => Project Structure => Android NDK location:
Select where your ndk located
3.Define jni module name
add below code in defaultConfit of module build.gradle
ndk{
moduleName "leonjni"
}4.Add jni folder5.Add load library ,add native method,call native method6.Generate jni code from native method(alt+enter)7.Change some text in jni file(c file)8.Run the app,text in jni file had worked.Have fun.