I am trying to figure out the best way to store my application key and other application specific data. Android uses a file to do it - http://android-developers.blogspot.com/2011/03/identifying-app-installations.html
I found that using SharedPreferences is faster and more efficient. Why does Android use a dedicated file just to store the installation ID instead of using preferences? Both require the app开发者_StackOverflowlication context, so that is not a reason.
I guess so that the UUID is persisted across installations if the phone is not factory-reset.
An applications SharedPreferences
are removed when that application is uninstalled. So if a user uninstalled/re-installed and the ID was stored in SharedPreferences
then the ID would be different after the re-installation.
精彩评论