A Content URI is simply a unique string uri associated with a particular query - they do not need to be related to your underlying table structure.
The "content://" + AUTHORITY + "/"
part of the URI attempts to ensure that the strings are unique (i.e., they don't conflict with other applications) by using an AUTHORITY that is unique to your application.
They have two main purposes:
- Allowing your
query
,update
,insert
, anddelete
calls to easily distinguish between different queries (of course, you could use theselection
,projection
, or other parameters to do this, but often times the URI is much easier to quickly parse using a UriMatcher) - Allow you to call Cursor.setNotificationUri on a returned
Cursor
which will automatically re-query the data when ContentResolver.notifyChange(uri, null) is called (i.e., in your insert/update/delete calls). This is particularly useful when using the Loader Framework and a CursorLoader to automatically receive callbacks when the underlying data changes.