I want to create a XML file inside my Android app. This file I want to write into the documents folder of my Android device. Later I want to connect my Android device to my PC using USB and read that XML file out of the documents folder. My Device is an Android Galaxy Tab Pro 10.1, Android 4.4.2.

I tried already:

String fileName = "example.xml";
String myDirectory = "myDirectory";

String externalStorage = Environment.getExternalStorageDirectory().getAbsolutePath();

File outputFile = new File(externalStorage + File.separator + myDirectory + File.separator + fileName);

But no file is created. I also want later to read that file out of the documents folder into may app again.

Any help is appreciated, thanks!

Related posts

Recent Viewed