Immutable URI reference. 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.
1. Create an Android app if you don't already have one.
2. In the MainActivity.java file, add the below to the imports section.
import android.net.Uri;
3. Add the line below to the onCreate method. This creates and names a new Uri named myUri.
URIs are either absolute or relative. Below is an example of a relative URL that is set to the Media on your device.
Uri myUri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
4. Compile and run!
Resources:
http://developer.android.com/reference/android/net/Uri.html
http://developer.android.com/reference/java/net/URI.html
http://androidbook.blogspot.com/2009/08/referring-to-android-resources-using.html
4. Compile and run!
Resources:
http://developer.android.com/reference/android/net/Uri.html
http://developer.android.com/reference/java/net/URI.html
http://androidbook.blogspot.com/2009/08/referring-to-android-resources-using.html