Monday, 4 January 2021

Android JNI Example 2

  Hi Guys !!! Hope all is well

In my previous post Android JNI Example 1I have discussed following : 
  • How to use latest Android Studio to develop Native application(NDK, JNI,CPP)
  • Received String from Native layer to Upper layer (App)
  • Send String from Application to native layer
  • Received String Array from Native to Upper layer
Now in Example 2, I am going to discuss following :- 
  • 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

The example code is on my github page

https://github.com/Saurabh-12/AndroidJNI


You can see code snippet for above example on my github page. So i am not doing it here copy paste.



 

Thanks
Saurabh 
Happy Coding !!!

1 comment:

  1. the simplified capacities for video, sound, and impacts, More Info

    ReplyDelete

Build a Custom Kernel Module for Android

Hi Guys!!!Hope you are doing well !!!. Today I will describe how you can write a custom kernel module(Hello world) for Android and load it a...