How can I load an image from URL without extension

33
October 09, 2019, at 3:50 PM

I'd like to load an image from a URL but it doesn't work because the link doesn't have an extension Can this be solved??? URL example : http://d1s5a4e3za7rni.cloudfront.net/Custom/Content/Products/10/13/1013450_purificador-de-agua-electrolux-pc41x-prata_s4_636822411415208179

Example on device :enter image description here

Answer 1

You can use Glide.

If your Web server serves an image at that URL, with a valid image MIME type, Glide will handle it. Glide doesn't care about the extension, it loads the byte stream returned by the server, it wants a valid URL that supplies a valid image MIME type.

Example:

// For a simple view:
@Override public void onCreate(Bundle savedInstanceState) {
  ...
  ImageView yourImageView = (ImageView) findViewById(R.id.image_view_id);
  Glide.with(this).load("image_url").into(yourImageView);
}

To use Glide in your project see download-setup.

READ ALSO
How to get value from TypedArray without passing default value

How to get value from TypedArray without passing default value

I'm using the below code to retrieve values from TypedArray in a custom view, but there is something I don't getIf I'm passing default style as 4th parameter then why I have to use getXXXX(R

33
How do you track screens as pages on Google Analytics? (website view using app data)

How do you track screens as pages on Google Analytics? (website view using app data)

We have an Android app we'd like to track pages using Google Analytics withI've integrated the Google Analytics SDK through Play Services 17

36
Notification not receive when Application terminated in android

Notification not receive when Application terminated in android

I use firebase push notification to device tokenWhen app is opening or in foreground I can get notification well

54
How do I connect an Azure MySQL Database to my iOS and Android App

How do I connect an Azure MySQL Database to my iOS and Android App

Entirely new to this and was hoping to find some reasonably straightforward API's or documentation to connect the MySQL database I have on Azure to the iOS and Android apps I have in development

22