0

In my app, I want to store and read static information for Android permissions. Each permission has three to four attributes (name, short description, detailed description etc.) Earlier, I stored this data in different .properties files like each file has (key, value) pairs. But I think, this is really a bad design. I need a new file for each attribute in this case.

File1.properties

...
ACCESS_MOCK_LOCATION = Allows an application to create mock location providers for testing
ACCESS_NETWORK_STATE = Allows applications to access information about networks (Wifi, 3g, 4g)
...

So can I use SharedPreferences for this purpose in place of sql database? Other links on SO suggest that I should store only primitive data types in SharedPreferences. Can I use gson to store this information? Can someone please advise me on this? Thanks.

Community
  • 1
  • 1
Junaid
  • 1,668
  • 7
  • 30
  • 51

1 Answers1

1

THis sounds like a use for a SQLite database. You have a large number of rows with fixed data types that you want to be able to retrieve and possibly search. A database is a perfect fit.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127