2. What are they?
• Managers of Structured Data
• Abstract underlying data storage
• Allow external access to data by apps
3. Why use them?
• Manage Connection to data source (open, close
connection and so on)
• Easily access data
• Provide data to external apps if required
• Search Suggestions
• Sync Adapter
• Implicit Intent
• Loader callbacks
4. So what is the problem?
•
•
•
•
•
•
•
•
Boilerplate code between projects
Maintaining DB version
Its not thread safe
Json – SQL mapping
Logic distributed over different parts of the app
Lack of visibility of whats going on
Rigidity of the API in making queries
Any change to content on the UI must result in a
corresponding change to backend data i.e. deletes
involves a round trip to the DB
5. What can we do?
Libraries
–
–
–
–
SQLiteProvider: https://github.com/novoda/SQLiteProvider
stORM: https://code.google.com/p/storm-gen/
GreenDAO: http://greendao-orm.com/
……….Enter your favourite library here
6. SQLiteProvider
• Already implemented boilerplate code
• Versioning is relatively easy
• Additional uri options is supported such as “limit”
– content://com.example.sqliteprovider/users?limit=5
– content://com.example.sqliteprovider/user?groupBy=dob
– content://com.example.sqliteprovider/users?name=“Akshay Dashrath”