AHPreferenceActivity Directory

pesquera

Active Member
Licensed User
Longtime User
Hi,
I want to know on what folder/directory this library stores the preferences
I would like to store them on a private directory, so another users can't copy them with an explorer utility
Thanks in advance
Marcelo
 

yttrium

Active Member
Licensed User
Longtime User
They're stored at the following path:
/data/data/com.your.package.name/shared_prefs/packagename_preferences.xml

If you move them from this directory, AHPreferenceActivity will recreate the default options at this directory. Without modifying AHPreferenceActivity itself, there is no way to change this path.

Note that the only way the user can actually even view this path is via root access. If a user is not rooted, they will not be able to tamper with the app, but if they are rooted, there is nothing you can do to stop them from finding the private directory. The default should be fine for most needs. If it isn't secure enough, you could perhaps try encryption.
 
Upvote 0

pesquera

Active Member
Licensed User
Longtime User
Thank you so much, your explanation was so clear to me.. I have not much experience with android yet
I don't know how many is the population that are rooted
I'm working on a project that will be sale on a subscription basis, and seems not to be a good idea to save the field "out of date" into this folder
If somebody has a similar experience to share, this will be so great for me
 
Upvote 0
Top