0

I need to store some config predefined information in my Android app such as the list of the servers, logins and passwords. This information should be stored permanently and be editable. For some reason, I think SharedPreferences isn't what I'm looking for. Maybe using internal Android SQLite db would be better?

What do you think?

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • 1
    Possible duplicate of [SQLite or SharedPreferences for persistent data storage?](http://stackoverflow.com/questions/4909701/sqlite-or-sharedpreferences-for-persistent-data-storage) – e4c5 Oct 24 '15 at 14:55

3 Answers3

1

You can store predefined data in a .db file under R.raw and copy it to your app's working directory then use it with SQLite.

hata
  • 11,633
  • 6
  • 46
  • 69
0

You can specify these setting values in program as variables and insert in sqlite on first launch of application, By this way you can edit these values later in sqlite, I hope this can help you.

Sagar Yadav
  • 137
  • 2
  • 11
0

I have generally found SharedPreferences to be more easier to implement (also demands less resources than any kind of database). In your case, in my opinion, you should go for SharedPrefences, by loading your required information on first launch through some predefined keys, example, URL + i, where i can be run from zero to the number of URLs. This can be then later retrieved and edited. You can save the initial values in arrays as suggested by others above.

dejavu89
  • 754
  • 1
  • 7
  • 17