Shruti
Shruti

Reputation: 5591

Android Preferred Storage

We are developing an application in android,We have to save some lists and data to be used by application.We have saved it in sqlite and we use that data by using cursor.

Now my question :

What is more efficient to store data in we should continue with sqlite or to store data on strings.xml or we should use shared preferences ??

Upvotes: 0

Views: 281

Answers (4)

user1213856
user1213856

Reputation: 86

Sql Lite is for sharing your data as a datasource. It does not make sense otherwise as you have the overhead of writing queries to serialize your objects.

Shared Preferences is a preferred way to store internal data. You can't use assets as said by someone else before because its read only.

Upvotes: 2

Ghost
Ghost

Reputation: 3966

Shared Preferences are generally used to store primitive data. I'd suggest you to go with SQLite .

Upvotes: 0

AndroDev
AndroDev

Reputation: 3304

In your scenario, I think best way to store is in asset folder. Means store that data in txt file in key-value pair and while displaying in list, your just have to read that and display in the list. So that saving step can be avoided.

Upvotes: 1

Raman
Raman

Reputation: 262

Well It Depends on your requirements. If your requirements are dynamic then you should try Sqlite for Storing the Datas.

You should use String.xml to store constant strings, which are not going to change easily ( i mean by increment or decrement of Strings ).

Upvotes: 2

Related Questions