122k views
0 votes
Which URI follows standard conventions for specifying a single row within a table of cities?

A. content://com.example.provider/cities/all
B. content://com.example.provider/cities/single
C. content://com.example.provider/cities/row/1
D. content://com.example.provider/cities/#/row

1 Answer

4 votes

Final answer:

Option C, content://com.example.provider/cities/row/1, follows standard conventions for specifying a single row in a URI format, by referencing the row's ID.

Step-by-step explanation:

The standard convention for specifying a single row within a table of cities in URI (Uniform Resource Identifier) formats would typically involve specifying the ID of the row. Among the provided options, the one that follows this convention is C. content://com.example.provider/cities/row/1. This format suggests that you are querying for a city with the ID of 1 from the 'cities' table in the content provider identified by 'com.example.provider'. The other options either refer to multiple items (e.g., all cities) or do not follow the typical convention for specifying a single item by ID.

The correct URI that follows standard conventions for specifying a single row within a table of cities is content://com.example.provider/cities/row/1.

Each part of the URI has a specific meaning. The com. example. provider represents the content provider's authority. cities refers to the table name in the database, and row/1 specifies the primary key value of the desired row.

Using this URI, you can retrieve information about a specific city by specifying its primary key value in the row/1 segment of the URI.

User Pedro Hidalgo
by
8.2k points