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 post that as well)
First convert javaURI to string and then use android.net.Uri's parse function
android.net.URI androidUri = android.net.Uri.parse(javaURI.toString());
http://developer.android.com/reference/android/net/Uri.html#parse(java.lang.String)
Therefore, here is an example:
Goes without saying, use the real
java.net.URI
in it... ;)For anyone coming across this, I had success with the following code:
Basically, get each URI component and pass it to the builder (as there does not seem to be a way to pass in a whole URI string.