title: Using opencv FileStorage native in android
body: <p>I am trying to write an android applications witch calculates keypoints and descriptors using opencv and store them. However i am getting troubles with cv:FileStorage. I am actually passing the file path throw native methods. The same path (different file ending) is also used to store another file on the javaside.</p>
  
  <pre><code>JNIEXPORT void JNICALL Java_com_..._CalcFeatures(JNIEnv* env, jobject, jlong addrGray, jstring location){
  ...
  const char *nativeString = env-&gt;GetStringUTFChars(location, NULL);
  string filepath=string(nativeString);
  FileStorage fs(filepath, FileStorage::WRITE);
  fs&lt;&lt;"frameCount"&lt;&lt;5;
  fs.release();
  ...
  }
  </code></pre>
  
  <p><strong>LogCat output:</strong></p>
  
  <pre><code>Fatal signal 11 (SIGSEGV) at 0x000009f4 (code=19), thread 23789 
  </code></pre>
  
  <p>I also tryed to hardcode the path (like „/sdcard/test.xml“ or „/storage/emulated/0/text.xml“). If I am using “test.xml” as filepath, I don’t get any errors, but I am not able to find the file on my phone (HTC One).</p>
  
  <p>Any advices?</p>
  
  <p>Thanks for your time.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>this works just fine, so there is a problem with FileStorage. Is there any other way in opencv to parse it to an xml/json format? perhaps with string as result?</p>
  
  <pre><code>FILE* file = fopen(nativeString,"w+");
  fputs("hello, world\n", file);
  fclose(file);
  </code></pre>