I've also struggled with the the distinction between a ContentProvider
and just using a sqlite database.  Clearly if the application is
exporting data to other (potentially unknown) applications then a
ContentProvider would make some sense.  The more complicated case
seems to be a single application that has two processes in it (e.g, an
application with a long running service).  In this case it seems like
you could simply share at the sqlite database layers, but the locking
and sharing story on the sqlite database APIs is somewhat unclear.  By
using the ContentProvider APIs, it looks like you sidestep these
issues because all access to the database will be through a single
process and ContentResolver provides a bridge between the processes.

Kevin McCurley

On Sep 10, 1:00 am, Dianne Hackborn <hack...@android.com> wrote:
> If you need the features content provider adds (primarily interaction across
> separate application and associated discovery and cross-process calls, as
> well as MIME typing to integrate with intent resolution) then consider using
> it.  Otherwise there probably isn't a reason to.
>
>
>
> On Thu, Sep 10, 2009 at 12:11 AM, jayant <jayant.jais...@gmail.com> wrote:
>
> > Hi Dianne,
>
> > i get ur point that Content provider is built on top of  SQlite but i
> > wanna know is what additional features does a provider support. Say if
> > a make my own Database Store class  and provide methods in it to
> > insert/update/delete into a database.
>
> > And if i create  a Provider for the same purpose, ...in what way will
> > a Provider prove to be more beneficial over the DatabaseStore class
> > other than the fact that provider will allow me to share data ovet
> > different applications
>
> > On Sep 10, 11:01 am, Dianne Hackborn <hack...@android.com> wrote:
> > > Content provider is (generally) built on top of SQLite.  You don't pick
> > one
> > > or the other.
>
> > > On Wed, Sep 9, 2009 at 9:24 PM, Chris <narendrasingh.bi...@gmail.com>
> > wrote:
>
> > > > I would like to know the exact difference between Content provider and
> > > > SQLiteDatabase. If we have to share our data among applications then
> > > > we use Content provider, otherwise SQLiteDatabase. Is this is the ONLY
> > > > difference, OR using Content Provider has something to do with
> > > > performence???
> > > > Any input will be highly appreciated.
>
> > > > Thanks
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support, and so won't reply to such e-mails.  All such
> > > questions should be posted on public forums, where I and others can see
> > and
> > > answer them.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to