I'm trying to return an Android device ID number from Java to C ++:
Currently I have the following:
in C ++:
jstring java_com_incket_onePlayRL_OnePlayRL_uniqueCode (JNIEnv * env, obj for job, jstring passcode) {const char * ucstr; Ucstr = env- & gt; GetStringutforhars (passcode, 0); CCLog ("string id is% s", ukr); Env-> Release stringifiers (passcode, ukr); } On the Java Side:
Public Basic String Exclusive Code (String Passcode); Static reference mContext; Private Stable Activity = Faucet; String identifier = null; Telephony Manager TM = (Telephony Manager) mContext.getSystemService (context.TELEPHONY_SERVICE); If (TM! = Null) identifier = tm.getDeviceId (); If (identifier == faucet identifier length =) 0 = identifier = secure .getString (me.getContentResolver (), Secure.Android_id); Unique code (identifier); Currently Java part is said in the beginning under another method, this is what comes back in the log:
string id e384d223aab74897 invalid In the indirect context 0xfffffe5c, any help would be greatly appreciated, in the decodederrarrm VM failure fatal signal 11 (SIGESGV) 0xdeadd00d (code = 1), thread 25515 .
Your Function Some jstring value:
Code> jstring java_com_incket_oneplayRL_OnePlayRL_uniqueCode (...)
No comments:
Post a Comment