-3

I am new to android and I want to download an image from an url without extension '.jpg' or '.png' and etc ... Examples of this URL. Then I want to show it in an imageView.

Please help me. A big thanks for your help.

Ahlem Jarrar
  • 1,129
  • 1
  • 12
  • 33
  • 2
    Please edit in what you have tried –  Aug 18 '16 at 19:32
  • 1
    What is the problem? Why would with or without be different? – greenapps Aug 18 '16 at 19:35
  • I think you are trying to extract image from html, let us know what have you tried? – sumandas Aug 18 '16 at 19:37
  • This is more difficult than you might think. You have to go through the HTML code and search for the specific image, which is no problem when there is only one image on the page but a bigger problem when there are more. Also if the HTML code differs, maybe the android code needs some more adjusting too. You will need to explain a bit more about what you are trying to do. – JustRandom Aug 18 '16 at 19:38
  • @Dominik K Thank you for help me . – hamid.zz Aug 24 '16 at 20:22
  • 1
    @sumandas thank you my friend , i want to extract image from html , but i dont know how ... – hamid.zz Aug 24 '16 at 20:26
  • i want to extract image from html , but i dont know @greenapps – hamid.zz Aug 24 '16 at 20:27
  • Why dont you edit your post ? You have had time enough to tell what you want now. – greenapps Aug 24 '16 at 21:50

2 Answers2

1

You can use Picasso.

Example:

Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);
Rumit Patel
  • 8,830
  • 18
  • 51
  • 70
larsgrefer
  • 2,735
  • 19
  • 36
0

The way your question is phrased makes it sound like you don't have access to a direct link to an image and need to extract it from a webpage. There is no built-in way to do this in Android (to my knowledge).

You could create your own algorithm that processes the source code of the web page and returns any URLs that end in .jpg, .png, or any other image extension you need. From there you would follow something like this to download the images into ImageView objects.

Community
  • 1
  • 1
MarkyDD
  • 272
  • 5
  • 16