(FRONT) FRONT (2017)

Android JNI

Definition: JNI is a framework that allows Java code to interact with native code (code written in other languages like C/C++). It's a crucial component for Android development when you need to use native libraries or optimize performance-critical sections of your app.

Purpose:


Key Concepts in JNI Programming

Native Methods:


   1:      class MyNativeClass {
   2:          external fun myNativeFunction(input: String): String
   3:          // ... other methods
   4:      }

Implementation::


   1:  extern "C" jstring 
   2:  Java_com_example_ndk_MainActivity_stringFromJNI( JNIEnv* env, jobject thiz)
   3:  {
   4:      return (*env)->NewStringUTF(env, "Hello from JNI !");
   5:  }

JNIEnv (JNI Environment):




AndroidJavaLearning context:



Comments ( )
Link to this page: http://www.vb-net.com/AndroidConcept/Index10.htm
< THANKS ME>