Android Tutorial

(avery) #1
Android Tutorial 357

Updating the Manifest File

Finally, you need to update your application’s AndroidManifest.xml
file so that it reflects that a content provider interface is exposed to
the rest of the system. Here, the class name and the authorities, or
what might considered the domain of the content:// URI, need to
be set. For instance, content: //com .android book. Track Point
Provider is the base URI used in this content provider example,
which means the authority is com.androidbook.TrackPointProvider.
The following XML shows an example of this:

<provider
android:authorities=”com.androidbook.gpx.TrackPointProvider”
android:multiprocess=”true”
android:name=”com.androidbook.gpx.TrackPointProvider”



The value of multiprocess is set to true because the data does not
need to be synchronized between multiple running versions of this
content provider. It’s possible that two or more applications might
access a content provider at the same time, so proper
synchronization might be necessary.

Working with Live Folders

A LiveFolder (android.provider.LiveFolders) is a powerful feature
that complements the content provider interface. A LiveFolder is a
special folder containing content generated by a content provider.
For example, a user might want to create a LiveFolder with favorite
contacts (“Fave Five”), most frequently viewed emails in a custom
Free download pdf