Skip to content Skip to sidebar Skip to footer

What Is The Difference Between Uri And Uri Class

I am confused , how to use Uri because i am using it in android development at Intent's Action dial Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse('tel:555-2368')); Wha

Solution 1:

According to the Android API docs you can create a file Uri with:

public static Uri fromFile (File file)

Solution 2:

java.net.URI is mutable

android.net.Uri is immutable

java.net.URI

A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC 2396.

android.net.Uri . 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. This class is very forgiving--in the face of invalid input, it will return garbage rather than throw an exception unless otherwise specified.

Solution 3:

URIs identify and URLs locate; however, locations are also identifications, so every URL is also a URI, but there are URIs which are not URLs.

URL - http://example.com/some/page.html

URI - /some/page.html

Post a Comment for "What Is The Difference Between Uri And Uri Class"