Mar 16, 2010

Android-Content Providers...

Activities, Service, Content providers, Broadcast receivers the four heros of android... hu hu ha ha.. So this scratch is for the content providers.. simple defnition is 'provider of the content' or database...

Some points...
  1. Android applications can use a file or sqlite database to store data.
  2. CP provides a way in which we can share data b/w multiple applications
  3. Consider Contact DB.. If it is used by different apps,... put it in CP for to hv common access.
  4. if u want u r data to b public and accessed by many apps,.. put it in u r own content provider.
Apps can do following operations on CP
  1. Querying data
  2. Modify records
  3. Add records
  4. Delete Records
Standard CP are there : contacts, images.. implemented by android.

Querying data: We require content provider URI, URI consist of 3 parts..
  1. the string “content://”,
  2. segment representing kind of data to retrieve and
  3. optional ID of specific item of the specified content provider
URI : ( what is its full form ? )
  1. query URIs are somewhat arbitrary and confusing.
  2. For this android provide list of helper classes in android.provider package that define these query strings
this much is from : http://www.androidcompetencycenter.com/category/android-basics/

------------------------------------PART II-----------------------------------

So some scratches about Database ( before CP ) Okie ?.. Okie...
  1. Android uses Sqlite database system
  2. the database that you create for an application is only accessible to itself, others can't access it. is stored in the/data/data//databases folder
  3. Creating the 'DBAdapter' Helper Class; that creates, opens, closes, and uses a SQLite database. encapsulate all the complexities of accessing the database.
More about tat in this link: http://www.devx.com/wireless/Article/40842

Try with the Listings.. I m gonna try....

uph... a little difficult.. okie.. again bk to basics.... hureeee..... HLT

next Page: http://www.devx.com/wireless/Article/40842/0/page/2


reference
Cursor: http://developer.android.com/reference/android/database/Cursor.html
Context: http://developer.android.com/reference/android/content/Context.html

For Web Developer

  open -a "Google Chrome" --args --disable-web-security