Filesystem root path independent code
String content = "Hola mundo"; FileOutputStream fos = openFileOutput(FILE_NAME, Context.MODE_PRIVATE); fos.write(content.getBytes()); fos.close();
This will create a file on your application private space, so no other applications can access to it.
Great thing is that you don't need to know anything about paths, permissions, inputstreams, ... Just let Android handle it for you.
No hay comentarios:
Publicar un comentario