Reputation: 56189
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
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
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