I found that the problem was located in the file
getWriteablePath() made my app crash.
Then I found that if i did not clean up the char array (tmp) (line 144) if fixed the problem. Don’t know what this means but for now I do not clean up tmp.
The other thing I found was that the function getPackageNameJNI (line 136) did not work for me, as it returns some crazy letters and signs. For now I have hard coded my app package name, which works fine, but I would be glad if you could tell me what is wrong?.