I’m creating an app which has several users. I’ve created an object (user), which holds more details (name, age, custom objects etc). Because I have a custom object, I know it’ll be difficult to use shared preferences. What would be the best way to store the users data? I’ve looked into SQLite, but I can’t find a way to save custom objects into SQLite?
Any advice would be appreciated.
You can store objects in using any of the ORM libraries, one I would suggest is ORMLite
Use SQlite with ORM
ORMLite has a Android backend which makes calls to the native Android OS database APIs to support its ORM functionality. A number of Android developers that are using the framework successfully. See here for more information:
In terms of many-to-many relationships, ORMLite does not support cascading or any of the more advanced ORM features but there are examples of easy many-to-many implementations:
Use db4o with ORM
Instead of storing them in SQLite you may store them in db4o, which is specifically designed for storing objects. A simple tutorial for sotring objects using db4o.