![]() We fix this by first generating the appropriate C/C header files using the C Header and Stub File Generator - javah. This will compile and generate some necessary class files.Īndroid studio will mark this as an error because we don't have the corresponding JNI method defined yet. Save and build your project by selecting Build > Make Project public static native String getStringFromNative() This is an abstract method with the native keyword. To begin, add a native method to your class file. In order to invoke native C/C code in your application, you have to use the Java Native Interface (JNI). In the SDK tools tab, scroll down the bottom of the page and select Android NDK and then click apply to install. Or from the tools menu Tools > Android > SDK Manager You can access this through File > Settings > Appearance
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |