Hi,
After you complete java call in onComplete means in listener you call the native method to passback values that native method will store that value in static format for you can store in user-default.
for java native calling you find on internet, you can refere this http://mobile.tutsplus.com/tutorials/android/ndk-tutorial/
may be you are getting null-pointer due to data-conversion from c++ to java http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/types.html#wp276
so string passing,
void CCApplication::openURL(char *msg){
JniMethodInfo minfo;
if(JniHelper::getStaticMethodInfo(minfo,
“org/cocos2dx/lib/Cocos2dxHelper”,
“openURL”,
“(Ljava/lang/String;)V”))
{
jstring StringArg1 = minfo.env~~>NewStringUTF;
minfo.env~~>CallStaticVoidMethod(minfo.classID, minfo.methodID, StringArg1);
minfo.env~~>DeleteLocalRef;
minfo.env~~>DeleteLocalRef(minfo.classID);
}
in cocos2dxHelper method you will get string in agrs,
public static void openURL(String url) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
me.startActivity(i);
}
}
just try this, then may you can modified it later.
Thank you.