Rahul's Tech Blog

Growth Hacking, Just Hacking or No hacking !!!

July, 2015

Hello World JNI program in NDK using

  Create new android application Create a new native method public native String nativeFunction(); Then run this command from inside /app/src/main javah -d jni -classpath /Applications/adt-20140624/sdk/platforms/android-19/android.jar:../../build/intermediates/classes/debug:/Applications/adt-20140624/sdk/extras/android/support/v7/appcompat/libs/android-support-v4.jar:/Applications/adt-20140624/sdk/extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar com.rahulprasad.www.ndksample.MainActivity This will create jni folder inside src This will also create a header file called com_rahulprasad_www_ndksample_MainActivity.h Duplicate the header file as main.c and remove everything except function initialization. Include […]