A (175)

(Tuis.) #1

514 CHAPTER 14: Android Content Providers: Providing Data to Applications


Next let’s take a look at the MediaStore and CalendarContract databases and their tables, and
then you will get into how to use the Uri object you learned about earlier in the book with the
content:// Content Provider URI.


The Android MediaStore Content Providers


The other collections of Content Providers that you may find important for new media content within
the Android OS are the MediaStore Content Providers. These are listed in Table 14-3.


Table 14-3. Android MediaStore Content Providers
Database.Table Interface Database Table Contents
MediaStore.Audio.AlbumColumns Album information
MediaStore.Audio.ArtistColumns Artist information
MediaStore.Audio.AudioColumns Audio information
MediaStore.Audio.GenresColumns Audio genre information
MediaStore.Audio.PlaylistsColumns Audio playlist information
MediaStore.Files.FileColumns Fields for master table for media files
MediaStore.Images.ImageColumns Digital images
MediaStore.Video.VideoColumns Digital video
MediaStore.MediaColumns Generic media storage

Later in this chapter, you will look at how to declare content providers for use, access them, read
them, modify them, and append to them. First, let’s take a look at one more often used Android
OS database, the CalendarContract database, and then you will look at how to use Uri objects to
reference Content Providers.


The Android CalendarContract Content Providers


The CalendarContract databases include eleven calendar-related databases, each supporting
various calendar functions, including events, attendees, alerts, reminders, and other similar
calendar-related data support functions.


The reason that the Android operating system provides pre-built support, via its android.provider
package, for your Android calendar database access is because it would be logical for applications
that access these calendar features to be able to add customized, new capabilities to the existing
Android calendar feature set.


Table 14-4 shows the CalendarContract Content Provider interfaces, as well as the different types
of calendar functional data they access, and which they will allow you to reference directly using a
Content Provider.

Free download pdf