AndreiBogdan
AndreiBogdan

Reputation: 11164

Android. User access to SharedPreferences

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.

Upvotes: 1

Views: 203

Answers (1)

JAC
JAC

Reputation: 287

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

Upvotes: 2

Related Questions