Programming Android

Data directory have no read write permission in Android

steloflute 2012. 8. 5. 15:17

http://stackoverflow.com/questions/1998400/data-directory-have-no-read-write-permission-in-android


If you're storing small files to do with your application then these can go into the phone's storage and not the SD Card, so use the Context.openFileOutput() and Context.openFileInput() methods.

So in your code consider something like:

OutputStream os = openFileOutput("samplefile.txt", MODE_PRIVATE);
BufferedWriter lout = new BufferedWriter(new OutputStreamWriter(os));