JoSem
JoSem

Reputation: 309

Xamarin listview with objects

If I have a class containing of integers, strings and a Date, how should I go about creating, saving and displaying a new instance of this class in my ListViews?

I've used SharedPreferences before for saving local strings but is this possible with objects as well, or should I look into SQLlite?

Edit: Also, if SQLlite is needed, a little steer in the right direction would be appreciated.

Upvotes: 2

Views: 129

Answers (1)

tequila slammer
tequila slammer

Reputation: 2879

You can still use preferences to save your objects but you need to serialize them into strings. And for later use you have to deserialize them from strings into your list of objects. This can easily be done with Json.net but I would recommend to use a database like SQLite. This would make it easy if new requirements like searching or object extension comes up.

A good entry into SQLite and Xamarin can be found here or here.

Upvotes: 1

Related Questions