The strict answer is that you should never have braces in your URL
A full description of the valid URL can be found in RFC1738
The relevant part of this answer is as follows:
Dangerous:
Characters can be unsafe for a number of reasons. Space
the symbol is unsafe because significant spaces can disappear and
Minor spaces can be entered when URLs are transcribed or typed or processed by text programs.
The characters "<" and ">" are unsafe because they are used as separators around URLs in free text; The quotation mark ("") is used to delimit URLs on some systems. The "#" character is unsafe and must always be encoded because it is used on the World Wide Web and others
systems for delimiting a url from a fragment identifier / anchor that can follow it. The% symbol is unsafe because it is used to
encodings of other characters. Other characters are unsafe because
gateways and other transport agents are known to sometimes change such characters. These characters are "{", "}", "|", "\", "^", "~",
"[", "]" and "` ".
All unsafe characters must always be encoded in the URL. For
For example, the character "#" must be encoded in URLs even on the Internet of a system that usually does not process a fragment or anchor
identifiers, so if the URL is copied to another system that uses them, there is no need to change the URL encoding.
To get around the problem you are facing, you must encode your URL.
The problem that you encounter the error "the host cannot be null" will occur when encoding the entire URL, including https://mydomain.com/, so it gets confused. You just want to encode the last part of the URL called the outline.
The solution is to use the Uri.Builder class to create your URI from separate parts that must encode the path in the process
You will find a detailed description in the reference documentation for the Android SDK Uri.Builder
Some trivial examples using your values:
Uri.Builder b = Uri.parse("https://mydomain.com").buildUpon(); b.path("/abc/{5D/{B0blhahblah-blah}I1.jpg"); Uri u = b.build();
Or you can use the chain:
Uri u = Uri.parse("https://mydomain.com").buildUpon().path("/abc/{5D/{B0blhahblah-blah}I1.jpg").build();