Skip to content

Tag: uri

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