1

I was wondering if the user has access to the SharedPreferences in which I store some app data. I intend to do a very simple counter which counts the number of times the user uses a feature in my app and if the value passes a certain predefined one, then I block the access to that feature. I do not intend to use a server to keep track of every such counter on every device which uses my app, but I would prefer to store this data locally.

The question is how easily can the user access the SharedPreferences and remove the data I store, thus resetting the counter. Where exactly does the SharedPreferences get stored? Is it easy to access?

It is not THAT important if the user does manage to reset the counter, it is not a critical thing, but I'd prefer to implement a simple method to at least discourage or make it a bit harder for him/her to do so.

1 Answer 1

2

SharedPreferences are stored in the device as an XML file. Users won't have access to this unless the device is rooted.

1
  • I see. And if the device is rooted I'm guessing the user will have read/write permissions on the file, including removing it altogether? (I've never actually handled a rooted phone) Feb 25, 2013 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.