Reputation: 29463
What is the recommended way to persist objects between uses of an app in the Android OS? These objects are of custom classes, not standard java classes.
Upvotes: 0
Views: 1470
Reputation: 8484
Android provides several ways to persist application data. If you are looking for a relational approach you should look here and start using SQLite.
If you are going to persist the state of an activity you have to do it in the onPause()
callback. If you want to persist data fetched in a service the basic rule is persist early, persist often.
Upvotes: 2