Android - Where to save text files to?

前端 未结 4 903
野性不改
野性不改 2021-01-16 12:26

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?

相关标签:
4条回答
  • 2021-01-16 12:43

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

    This location is private to particular app.

    0 讨论(0)
  • 2021-01-16 13:03

    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.

    0 讨论(0)
  • 2021-01-16 13:03

    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

    0 讨论(0)
  • 2021-01-16 13:04

    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.

    0 讨论(0)
提交回复
热议问题