title: Passing a string to C-code in Android NDK
body: <p>The program should take an Image from the SD card and adjust its brightness. And the image is taken from the SD card via the NDK C-code. It is to be noted that the string depicting the path to the image is passed to the NDK via JNI. </p>
  
  <p>Java code:</p>
  
  <pre><code>private void adjustBrightness() {
     imagePath     = (Environment.getExternalStorageDirectory().getPath()+"earthglobe.jpeg").toCharArray();
     brightness(imagePath, brightness);
  }
  
  public native void brightness(char[] imagePath, float brightness);
  </code></pre>
  
  <p>NDK code:</p>
  
  <pre><code>JNIEXPORT void JNICALL Java_com_example_ImageActivity_brightness(JNIEnv * env,char[] bitmappath, jfloat brightnessValue)
  {
     string bmpath    =   bitmappath+'\0';
     jobject  obj = fopen( bitmappath , "rb" );
  }
  </code></pre>