Providers
Upcoming SlideShare
Loading in...5
×
 

Providers

on

  • 696 views

 

Statistics

Views

Total Views
696
Views on SlideShare
696
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Providers Providers Presentation Transcript

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