Damir
Damir

Reputation: 56189

Save (store) list of simple objects on Android

I need to save List of simple objects

class simple{
String name;
byte[] data;
}

in android. How to do this ? Do I need SQLite or there is easier way ?

Upvotes: 1

Views: 1077

Answers (2)

Jaber Shabeek
Jaber Shabeek

Reputation: 186

Just refer serialization in java, and that makes your objects to be serialized. see an example here, http://www.jondev.net/articles/Android_Serialization_Example_%28Java%29

Upvotes: 2

Alexandre
Alexandre

Reputation: 1285

I'd use a database for that. It would make easier to get that data from different activities. Here is a great tutorial on dealing with database in Android.

I assume you can take that byte array as an INTEGER one for database type compatibility (or maybe some clever conversion to something else). The tutorial above provides you with info on the data types.

Upvotes: 1

Related Questions