0

I'm creating an app that will need, at the most, probably 16 account's basic information. This includes several items per account such as name, password, and some basic settings. This information will be used periodically throughout the app to access information on the web, and display it to the user as needed. I will probably also be storing other information, per account, in a SQL file so it can be searched, categorized and displayed when requestedd.

I am going to use a Pref Fragment to add/edit each of these account's main information for simplicity (they are all identical in format, just different values) but as I started reading on the differences between shared preferences and SQL, there are alot of pros and cons for using each.

Where would the best place be to store this basic information?

Is this information, including passwords more secure in one vs the other from outside prying eyes?

Some people say that shared preferences can sometimes get corrupted... is that something I need to worry about?

Peter
  • 427
  • 4
  • 14

1 Answers1

0

I've never had problems with corrupted shared prefs. If you're only ever going to have around 16 account entries, I think shared prefs would be fine (and easier to implement than a Sqllite db). If you do use shared prefs, just make sure to hash or otherwise avoid saving passwords in plain text. Pref files, although normally restricted (if you specify MODE_PRIVATE) still can be accessed when a phone is rooted.

Community
  • 1
  • 1
hungryghost
  • 9,463
  • 3
  • 23
  • 36