Providers

591 views
508 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
591
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Providers

  1. 1. Content Providers made easier with SQLiteProvider
  2. 2. What are they? • Managers of Structured Data • Abstract underlying data storage • Allow external access to data by apps
  3. 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. 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. 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. 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”
  7. 7. Any questions?

×