QUESTION 1(10 Marks)
Q1a.Explain the following methods of ContentProvider class [5]
(Note: Full marks is awarded if methods parameters and return type is explained.)
Answer)
i.canonicalize(Uri url):
Q1a.Explain the following methods of ContentProvider class [5]
(Note: Full marks is awarded if methods parameters and return type is explained.)
Answer)
i.canonicalize(Uri url):
- A canonical URI is one that can be transported across devices, backup/restore, and other contexts, and still be able to refer to the same data item. Typically this is implemented by adding query params to the URI allowing the content provider to verify that an incoming canonical URI references the same data as it was originally intended for and, if it doesn't, to find that data (if it exists) in the current environment.
- Parameters Url: uri: the Uri to canonicalize. this value must never be null
- Returns : URI Return the canonical representation of url, or null if canonicalization of that Uri is not supported.