I am trying to use the Glide Android library to load images from urls such as
String urlString = "https://images.example.com/is/image/example/EXMPL1234_021347_1?$cdp_thumb$";
When I enter the above url string into Glide,
Glide.with(mContext).load(urlString).into(view);
the address it actually hits is:
https://images.example.com/is/image/example/EXMPL1234_021347_1?%24cdp_thumb%24
which is for me incorrect. The $ must be preserved.
I tried then to pass in java.net.URL object in, but I again seem unable to construct one that preserves the $ character inside the query.
Here is an example of something I tried:
URL url = null;
try
{
url = new URL(urlStr);
URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath()+"?$hp_wn_thumb_app$", "", url
.getRef()
+"?$hp_wn_thumb_app$");
url = uri.toURL();
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
catch (URISyntaxException e)
{
e.printStackTrace();
}
I would be very grateful if someone could suggest a solution. to making non-urlencoded java URL objects.