If you do not want to write boilerplate code for database you can save your objects in JSON
or XML
format as files.
You got two ways:
- Store in filesystem using serialization to store and deserialization to read
- Store in
JSON
orXML
natively and write converter between your class and needed data format
Database is good solution, because SQLite
in Android is real fast and so on. But if you will want to change structure of table you will have to write ALTER TABLE
queries in onUpdate()
method of SQLiteOpenHelper
and other troubles.
So I would recommend to use XML
or JSON
to store data.
Upd
Also, you can mark your custom data class as serializable, store values in ArrayList or other structure and serialize it to store, then deserialize to read.