Saving file to phone in stead of SD-card

Posted by Galip on Stack Overflow See other posts from Stack Overflow or by Galip
Published on 2011-01-13T09:36:56Z Indexed on 2011/01/13 9:53 UTC
Read the original article Hit count: 258

Filed under:
|
|

Hi guys,

In my app I save an XML file to the users SD-card by doing File newxmlfile = new File(Environment.getExternalStorageDirectory() + "/Message.xml");

But not all users have SD-cards in their phone and therefore my app is likely to crash.

How must I change my File creating method in order to save the file to the phone's memory instead of the SD-card?

Also, how must I change the loading of the file? (currently: new InputSource(new FileInputStream(Environment.getExternalStorageDirectory() + "/Message.xml")))

© Stack Overflow or respective owner

Related posts about android

Related posts about file