title: jobject to jstring or char* conversion
body: <pre><code>JNIEXPORT void JNICALL Java_com_ex_android_rt_addFriends(JNIEnv* env, jobject obj,
      jint size, jobjectArray nodes)
   {
  
  jint count = (*env).GetArrayLength(nodes);
    for (int i=0; i &lt; count; i++) {
  </code></pre>
  
  <p><strong>// HERE I'M GETTING OBJECT FROM jobjectArray</strong></p>
  
  <pre><code>jobject element = (*env).GetObjectArrayElement(nodes, i); 
  
    if((*env).ExceptionOccurred()) {
       break;
    }
  //  jstring mStr = ?;
    const char *nativeString = (*env).GetStringUTFChars(mStr, NULL);
  
   // use your string
  
    CCLog(" - value - %s -  ", nativeString);
  
   (*env).ReleaseStringUTFChars(mStr, nativeString);
  
    (*env).DeleteLocalRef(element);
  }
  </code></pre>
  
  <p>I am getting jobject, how do I convert it into a jstring? I have tried:</p>
  
  <pre><code>jstring string = (jstring) (*env).GetObjectArrayElement(nodes, 0);
  </code></pre>
  
  <p>with no success.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I tried:</p>
  
  <pre><code>jstring mStr = (*env).GetStringUTFChars(element, 0);
  </code></pre>
  
  <p>and I'm getting </p>
  
  <blockquote>
    <p>cannot convert 'const char*' to '_jstring*' in initialization</p>
  </blockquote>