9.6 DatabaseDescription Class

Class DatabaseDescription contains static fields that are used with the app’s ContentProvider and ContentResolver, and a nested Contact class that describes the database’s only table and its columns.

9.6.1 static Fields

Class DatabaseDescription defines two static fields (Fig. 9.15; lines 12–17) that together are used to define the ContentProvider’s authority—the name that’s supplied to a ContentResolver to locate a ContentProvider. The authority is typically the package name of the ContentProvider subclass. Each Uri that’s used to access a specific ContentProvider begins with "content://" followed by the authority—this is the ContentProvider’s base Uri. Line 17 uses Uri method parse to create the base Uri.

Fig. ...

Get Android How to Program, 3/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.