刚开始玩 NDK,用的 ide 是 android studio,但 android studio 目前还不能很好地支持 NDK。
经过摸爬滚打,终于积累了些经验,记录下先~
android studio 下如果要生成头文件,比较麻烦的做法是在终端敲命令,比如:
javah -classpath build/intermediates/classes/debug:<ANDROID_SDK_PATH>/platforms/android-21/android.jar -o testJNI.h com.example.test.MainActivity
快捷点地就是自定义个 external tool。步骤如下:
1.
Ctrl+Shift+A ,在跳出的搜索框输入 add toolbar button,并按enter
2.
在出来的界面点击 external tool,并点击右边绿色的加号