开发者

How to store a value outside the application sandbox in android?

开发者 https://www.devze.com 2023-03-07 10:27 出处:网络
I have some values that needs to be stored outside the application sandBox? i.e even if the user uninstalls 开发者_运维问答the application and reinstalls the value stored before uninstall should be pr

I have some values that needs to be stored outside the application sandBox? i.e even if the user uninstalls 开发者_运维问答the application and reinstalls the value stored before uninstall should be preserved. Is it possible to do so.


You can store data in file on sdcard. But this should not be your application directory (which, if I'm not mistaken, will be cleaned up on uninstall as well).

Just to test, you can write file to the root of sdcard: /mnt/sdcard/you-file.xml. Though I would not recommend to write your files to the root file in the real application.

0

精彩评论

暂无评论...
验证码 换一张
取 消