As far as the Android platform is concerned, the URI is mainly divided into three parts: scheme, authority and path. Among them authority is divided into host and port. The format is as follows:
Scheme://host:port/path
As a practical example:
Content://com.example.project:200/folder/subfolder/etc
\---------/ \---------------------------/ \---/ \--------------------------/
Scheme Host Port Path
\--------------------------------/
Authority
Now you should know the meaning of those attributes in data flag, look at the data flag
<data android:host= "string"
Android:mimetype= "string"
Android:path= "string"
Android:pathpattern= "string"
android:pathprefix= "string"
Android:port= "string"
Android:scheme= "string"/>
1.Uri
Generic resource Identifier (Universal Resource Identifier, "URI").
The URI represents the data to be manipulated, and each resource available on Android-images, video clips, and so on-can be represented by a URI.
A URI generally consists of three parts:
The naming mechanism for accessing resources.
Host name where the resource is stored.
The name of the resource itself, represented by the path.
The Android URI consists of the following three parts: "content://", the path to the data, the ID (optional)
For some examples, such as:
Uri:content://contacts/people for all contact persons
URI:CONTENT://CONTACTS/PEOPLE/5 of a contact person
All pictures uri:content://media/external
The URI:CONTENT://MEDIA/EXTERNAL/IMAGES/MEDIA/4 of a picture
We often need to parse the URI and get the data from the URI.
The Android system provides two tool classes for manipulating URIs, Urimatcher and Contenturis respectively.
Although these two classes are not very important, mastering their use will facilitate our development work.
Let's take a look at the role of these two classes together.