Skip to content

Tag: uri

How can i store uri.toString to my java class?

I want to store a uri to my 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)'” I’ve tried storing the uri to a different class which was successful but I had to make another

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:!/archive, that is /archive found in a file provided by 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: 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

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