Anky
Anky

Reputation: 127

Android - Where to save text files to?

I'm building an Android app with Adobe AIR that lets user import and export .txt files. What is the best folder to use as a default path to save the .txt files to?

Thanks

Upvotes: 1

Views: 1204

Answers (4)

Royston Pinto
Royston Pinto

Reputation: 6721

You have two options

  • Save it in External phone storage like SD Card. This however will be visible to all users and applications as well. Users can delete it without you knowing about.

Next option is

  • Save it in internal phone storage, here no users and applications can access these files(unless if phone is rooted). But these files will be deleted one's the user selectes clear data from Settings -> Apps -> .

You will need to decide which options wieghs better and accordingly select an appropriate location to save them

Upvotes: 0

Marten
Marten

Reputation: 1356

You should save the file on the external SD card. Just create an own directory under Environment.getExternalStorageDirectory() that is named like your app and save them all in there. This is pretty much the convention.

Upvotes: 1

Hardik Trivedi
Hardik Trivedi

Reputation: 6072

best path would be /data/data/your packagename/files/somefile.txt

This location is private to particular app.

Upvotes: 0

Sebastian Breit
Sebastian Breit

Reputation: 6159

You can save the txt wherever you want. I would recommend you to try to save any file in the external memory, and if that fails, then into the phone memory.

Upvotes: 0

Related Questions