How to load image to listview from a website

badal405

Member
Licensed User
Longtime User
Hi Erel,
I was trying to load picture to the listview from my website but couldn't find anyway to load. As i mean that in the list view product picture will show and beside the picture product information will show too. All those value are coming from the web database even the picture's url link.

Other information i can easily get it from web data through web service but for the picture could not do anything. I will be grateful to you if you could give me an example.:sign0085:

Waiting for your reply.
My warm regards.
Shaukat
 

warwound

Expert
Licensed User
Longtime User
Are you already successfully retrieving text data from your server and displaying that data in a ListView?
Is so then the script on your server that generates that data could also return a base64 encoded string representation of the images you want to accompany the text.

Have a look at this search: https://www.google.co.uk/search?q=php+base64+encode+image&ie=UTF-8&oe=UTF-8

In PHP you'd load the image and use the PHP base64_encode function on the raw (binary) image data.
base64_encode would return a string which you could add to the existing data that is returned to your application.

Your application can now use the StringUtils DecodeBase64 method to decode the string back to a byte array and from there you'd recreate the image.

Martin.
 
Upvote 0

badal405

Member
Licensed User
Longtime User
Hi Martin,
Thank you very much for given me the idea. According to your advice i have solved the problem. Thanks again
Shaukat
 
Upvote 0

badal405

Member
Licensed User
Longtime User
Dear Erel,
I have successfully loaded pictures to the list view from the website. It is working fine with my mobile android gingerbread 2.1 but when i tried the same app with android ice-cream sandwich 4.1 or later version's mobile it's giving me a message while retrieving data, image from the web database.
Here i have enclosed the screenshot of the error.
Waiting for your kind reply.
Thanks and best regards.

Shaukat
 

Attachments

  • untitled.JPG
    untitled.JPG
    41.8 KB · Views: 419
Upvote 0
Top