Skip to content

Saurabh-12/AndroidJNI

Repository files navigation

AndroidJNI

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)

1. Android JNI Example 1

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

2. Android JNI Example 2

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

3. Android JNI Example 3 : Handling Exception

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

About

Android JNI example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published