Is It Possible To Read/edit Shared Preferences In Native Code?
I have an Android app that includes a C library using NDK to execute some some code. Within the C library I would like to update the applications shared preferences. My question...
Solution 1:
You can do anything you want in native code. It's just cumbersome - you need the JNIEnv object to first find the class ID, then the method ID, if you have any non-primitive types, you need to create those too. But then you just call the method, and you're done.
JNI Docs - look for FindClass
, GetMethodId
, CallVoidMethod
, etc.
Post a Comment for "Is It Possible To Read/edit Shared Preferences In Native Code?"