(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 ( )
<00>  <01>  <02>  <03>  <04>  <05>  <06>  <07>  <08>  <09>  <10>  <11>  <12>  <13>  <14>  <15>  <16>  <17>  <18>  <19>  <20>  <21>  <22>  <23>  <24>  <25
Link to this page: http://www.vb-net.com/AndroidConcept/Index10.htm
<TAGS>  <ARTICLES>  <FRONT>  <CORE>  <MVC>  <ASP>  <NET>  <DATA>  <TASK>  <XML>  <KIOSK>  <NOTES>  <SQL>  <LINUX>  <MONO>  <FREEWARE>  <DOCS> <TRAVELS> <FLOWERS> <RESUME> < THANKS ME>