Can I store data on an Android device to persist between installs?

后端 未结 3 1712
北恋
北恋 2020-12-31 10:04

I want to store a small amount of data in a way where it persists between application installs. I obviously can\'t use SharedPreferences as they are removes upon uninstallat

相关标签:
3条回答
  • 2020-12-31 10:40

    If the app is removed, the data is removed. You could put something on the SD card, but there's no reason to believe it would stay there. You might be able to work something through the application licensing mechanism. Details here

    0 讨论(0)
  • 2020-12-31 10:43

    yes. you can store some data in the internal memory or the sd card.this can be done by creating(.somename)folder which is invisible to user and create a file.txt to store the data.

    0 讨论(0)
  • 2020-12-31 10:45

    You can store the data in shared preferences and use a backup manager to have them backed up automatically. They should be restored once the app is reinstalled.

    There is no real way of blocking the app for certain persons. You could fore all your users to create an account to use the app and block the accounts but they always can recreate an account. You could store something on the SD-Card and check for it but malicious users can find that and delete it. You could try to get the user to authenticate themselves with their google account against your app (andlytics is using an authentication method like that) but the user can factory reset his phone and create a new google account.

    You have to choose how important the blocking of the users is and how much you want to annoy your other users because of some users that are not using your app as intended.

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