Exact Difference between "Content-Provider" and "SQLite Database"

Paresh Mayani picture Paresh Mayani · Jul 28, 2010 · Viewed 36.7k times · Source

i have done SQLite database programming for Android, but i dont know anything about Content-Provider except this: "As i have referred Android Developer page , Android SDK explained about "Content-provider" as it is used to store and retrieve data."

But then,

  1. What is the exact difference between "Content-Provider" and "SQLite Database"?
  2. Which is best to store data, when ?

Any example or helps !!

Answer

Paresh Mayani picture Paresh Mayani · Jul 29, 2010

I found one major difference, as follows:

Storing your data in a database is one good way to persist your data, but there's a caveat in Android-databases created in Android are visible only to the application that created them. That is to say, a SQLite database created on Android by one application is usable only by that application, not by other applications.

So, if you need to share data between applications, you need to use the content provider model as recommended in Android. This article presents the basics of content providers and how you can implement one.

I found this article at this link

Really nice information provided.