Android save app settings/data in Internal/External Storage

前端 未结 1 635
长发绾君心
长发绾君心 2021-01-15 01:11

I need a little help with understanding what can I do and cannot in android. I\'m working on application which needs to ask user in first start to select a device (internal/

相关标签:
1条回答
  • 2021-01-15 01:54
    1. Your limit on external storage(SDCARD) is determined only by its capacity, I'm not sure about the internal storage, maybe it's the same situation.
    2. You can extend SQLiteOpenHelper and create your own DB adapter, which will manage your database and store it on SD card or /data/databases directory. I think that it's better not to place database on SDCARD, because any other app can access it there. On the other hand, /data/ folder is private.
    3. It's tricky thing. You should be careful while copying data. Check whether directory of file exist, before writing into them. It's better to explicitly create all files and directories before trying to write to them.

    Here is a good example of Database Helper for accessing database. You can modify it so it can use both external and internal storage.

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