Android JNI example code for my blog https://saurabhsharma123k.blogspot.com I am going to add all JNI related uses in Android (Application or System programming)
- Application(java/Upper layer) to lower layer(c++/native) communication
- Native Layer to Upper Layer communication
- System App call to lower level call
- Android Framework to Lower level call
- All code are in java/c++
- Detail explanation on my blog( I will publish it time to time)
In this example :
- Received String from Native layer to Upper layer (App)
- Send String from Application to native layer
- Received String Array from Native to Upper layer
- More detail check My Blog
Below is application screenshot
![](https://github.com/Saurabh-12/AndroidJNI/raw/master/JNIApp_1.png)
In this example :
- Call and set value for POJO or Getter/setter class in Native(jni/c++)
- Call and set value for below Java Static and instance Method in Native(jni/c++) :
- Boolean
- Int
- Float
- Array
- String
- Access and set following Static and Instance variable value in Native(jni/c++):
- Int
- String
- float
- More detail check My Blog
Below is application screenshot
![](https://github.com/Saurabh-12/AndroidJNI/raw/master/JNIApp_2.png)
In this example :
- Handle Java/App exception from native(jni)
- Catch java/App exception in native and return back it to App
- Example of Fatal exception in native
Below is application screenshot
![](https://github.com/Saurabh-12/AndroidJNI/raw/master/JNIApp_3.png)