title: How to call java method from jni side?
body: <p>I have done some c-code functions in jni side, and all workings fine. </p>
  
  <pre><code>public native String getMessage() 
  </code></pre>
  
  <p>function is returning string from jni side to java side, and it works fine, and all other jni codes works also fine. But a problem is how can I return string in jni function which without using return , so</p>
  
  <pre><code>public native void getMessagewithoutReturn()
  </code></pre>
  
  <p>should be able to return string. Then I but getMessagewithoutReturn() function never ending loop using pthread as following you can see: (it works)</p>
  
  <pre><code>pthread_t native_thread;
  pthread_create(&amp;native_thread, NULL, native_thread_start_reading, env);
  </code></pre>
  
  <p>and each loop iteration time I have to be able to return string, so I can't use return, because it stop the function run.</p>
  
  <pre><code>pthread_t native_thread;
  pthread_create(&amp;native_thread, NULL, native_thread_start_reading, env);sted out that 
  </code></pre>
  
  <p>I have tested out that posix thread and all works fine in android side, because it's has been not start worker thread, but now just problem to get string in every iteration time, without using function return.  </p>