Linked Questions

22 votes
2 answers
34k views

Is there a way to convert from Uri to URL? I need this for a library I'm using, it only accepts an URL but I need to use an image on my device.
CaptainForge's user avatar
  • 1,395
448 votes
32 answers
471k views

I have an onActivityResult returning from an mediastore image selection which I can get a URI for an image using the following: Uri selectedImage = data.getData(); Converting this to a string gives ...
stealthcopter's user avatar
27 votes
3 answers
20k views

I am able to find how to convert android.net.Uri to Java.net.URI here but not vice-versa. So after spending some time I figured it out. Here is the solution(If there is another solution then please ...
Mayank Rana's user avatar
32 votes
1 answer
24k views

Possible Duplicate: Android: Get the size of a file in resources? I want to upload a file to a WebServer. To show the progress of the upload I need to know the complete size of the file. Since I ...
Soccertrash's user avatar
  • 1,901
4 votes
2 answers
11k views

When attempting to execute this code in an Android Activity: Uri testurl = Uri.parse("http://www.google.com"); Log.v("HTTPGet", "testurl.toString == " + testurl.toString()); the only output in Logcat ...
Nick Betcher's user avatar
  • 2,046
6 votes
1 answer
6k views

I have an android.net.URI object (of the kind returned by onActivityResult after MediaStore.ACTION_VIDEO_CAPTURE): it looks like content://media/video/media/33. I want to convert this into a File ...
AP257's user avatar
  • 94.7k
1 vote
6 answers
4k views

I am trying to play an mp3 using the Media player class. When I hardcode the mp3 resource it works, however I would like the resource to come from a string instead of directly accessing it like R.raw....
brux's user avatar
  • 3,230
2 votes
1 answer
3k views

I would like to remove a video that has been previously recorded using an Intent: Intent captureVideoIntent = new Intent( android.provider.MediaStore.ACTION_VIDEO_CAPTURE); ...
jgilrincon's user avatar
0 votes
1 answer
235 views

i'm following along this answer: Android- how can I convert android.net.Uri object to java.net.URI object? android.net.Uri INPUT_FILE; java.net.URI juri = new java.net.URI(INPUT_FILE.toString()); File ...
Arun's user avatar
  • 1,695
0 votes
1 answer
208 views

On this line in val contactUri: Uri? = data.data … val cursor = requireActivity().contentResolver .query(**contactUri**, queryFields, null, null, null) Type mismatch required Uri got Uri How ...
Martin Mbaabu's user avatar