Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding out all about Android Uri class - use and purpose

Tags:

android

uri

Does anyone have some helpful links to find out about Android Uri's?

For example, you get a Uri back from a "take a picture" Intent. What does a URI look like and how do you use it. Why are they used instead of filenames or file handles?

The Dev documentation on the Uri class is practically worthless. http://developer.android.com/reference/android/net/Uri.html It is only clear if you already know exactly what it is, and how to use it.

Thanks for any links.

like image 517
Peter vdL Avatar asked Mar 11 '10 18:03

Peter vdL


People also ask

What is the use of URI in Android?

A URI is a uniform resource identifier while a URL is a uniform resource locator.

What is URI in Android example?

A URI reference includes a URI and a fragment, the component of the URI following a '#'. Builds and parses URI references which conform to RFC 2396. In the interest of performance, this class performs little to no validation. Behavior is undefined for invalid input.

What is content URI in Android?

A content URI is a URI that identifies data in a provider. Content URIs include the symbolic name of the entire provider (its authority) and a name that points to a table (a path). When you call a client method to access a table in a provider, the content URI for the table is one of the arguments.

What is URI authority android?

content:// – Mandatory part of the URI as it represents that the given URI is a Content URI. authority – Signifies the name of the content provider like contacts, browser, etc. This part must be unique for every content provider. optionalPath – Specifies the type of data provided by the content provider.


2 Answers

I'd check out the content providers section

http://developer.android.com/guide/topics/providers/content-providers.html

It expalins URI's for the different content providers and how they work.

like image 134
Steve Avatar answered Sep 24 '22 16:09

Steve


Read this post it explained what is URI and URL ? Hope it will help to you.http://javapapers.com/servlet/uri-and-url-difference/

This is a list of URIs that can be used in intents. http://www.openintents.org/en/uris

like image 41
Dinesh Avatar answered Sep 23 '22 16:09

Dinesh