Is there any way to write in internal storage in Android? I tried the following from google developer site-
File file = new File(context.getFilesDir(), filename);
String filename = "myfile";
String fileContents = "Hello world!";
FileOutputStream outputStream;
try {
outputStream = openFileOutput(filename, Context.MODE_PRIVATE);
outputStream.write(fileContents.getBytes());
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
The problem is that whenever I uninstalls the app the file is also deleted. However I am required to keep that file even after uninstalling the App...