In my app I save an XML file to the user\'s SD card by doing File newxmlfile = new File(Environment.getExternalStorageDirectory() + \"/Message.xml\");
B
First you should check if External Storage (SD card) is available and ready to write to by checking getExternalStorageState(). Read more here: http://developer.android.com/guide/topics/data/data-storage.html#filesExternal
Then if SD card not available you can write to internal storage. Read more here for example on how to write and read: http://developer.android.com/guide/topics/data/data-storage.html#filesInternal