I have got the URI of an image from an Input Image Activity. I have passed this URI to the Main Activity using .putExtra. Now I have the URI of the image in the Main Activity and I want to save the image somehow in r.drawable folder or to convert it to a picture which I can save to r.drawable.
Tag: uri
How can i store uri.toString to my java class?
I want to store a uri to my donation.java class so that ill be able to fetch an image from firebase storage and display it on a cardview. However uri.toString is highlighted red and shows a “Cannot resolve constructor ‘donation(java.lang.String)'” donate.java donation.java I’ve tried storing the uri to a different class which was successful but I had to make another
Not able to get query paramter value using android.net.Uri#getQueryParameter
I’m trying to parse query parameters from a URL string using Uri.getQueryParameter(String key) but that method returns null for the passed-in key. That URL that I’m using is /endpoint/path?query1=foo&page[size]=1. I’m able to successfully get the value for query1 parameter but not for page[size](the method returns null for this key). My code looks like: As seen in the output of the
Extract file name from Java URL (file: and http/https protocol)?
I have various urls like this: These are all valid URLS, and I can convert them to a URL in java without errors: I want to extract the filename from each of the examples above, so I’m left with just: I have tried the following, but this doesn’t work for example b above (which is a valid URL): I can
Nested jar: URI
The format of the jar: URI scheme is simply defined to be jar:<url>!/[<entry>]. Is it possible to “nest” two such URIs together and refer to a file inside an archive inside an archive this way? Something like: This should designate /file inside an archive jar:http://example.com/!/archive, that is /archive found in a file provided by http://example.com/. However, URL.openConnection throws an exception:
Kivy on Android, JVM exception occurred: Attempt to invoke virtual method … on a null object reference
We’re trying to access the Android camera in the Kivy app we’re building. We first opted to use plyer but we were getting a ClipData.Item.getUri() error. We ended up trying to follow the details described here: https://github.com/kivy/plyer/issues/500#issuecomment-565532048 Now there seems to be a problem in getting the URI for a file. We have added this in AndroidManifest.tmpl.xml: and this in
Java URI doesn’t encode semicolons in path. Best practice here?
I’m working on a project where a local file is exported via HTTP. This involves getting a file URI, relativizing it using the exported path, tacking it onto the export URI and then handling that as a URL on the receiving end. Normally this works fine, but I run into trouble when the filename contains a semicolon. I narrowed it
Turning a string into a Uri in Android
I have a string, ‘songchoice’. I want it to become a ‘Uri’ so I can use with MediaPlayer.create(context, Uri) How can I convert songchoice to the Uri? Answer Here’s the doc http://developer.android.com/reference/android/net/Uri.html#parse%28java.lang.String%29
Creating custom URI scheme using URI class
I need to create a custom URI scheme for my project. i.e urn:myprotocol:{p1}:{p2}:{p3}:{p4} – opaque representation myprotocol://{p1}/{p2}/{p3}/{p4} – hierarchical representation. How can I add my scheme to Java URI class? Or, how can I make Java URI to understand my scheme, so I could use it in my code? Concrete examples are welcome. Answer Are you sure you need to