0

I am developing an android application in which i have data coming from Url,The url has 3 images,along with text.I want to show all the images in list along with text.I looked at the some sample url along with lazy loading,code,,,,can anyone guide me how to do this

It is the url http://www.harpreetvirk.com/PMEvents/PMe.svc/Speakers

Regards

user1004521
  • 3
  • 1
  • 3

2 Answers2

2

This could help you.

Bitmap bmImg;
void downloadFile(String fileUrl){
      URL myFileUrl =null;          
      try {
           myFileUrl= new URL(fileUrl);
      } catch (MalformedURLException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
      }
      try {
           HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection();
           conn.setDoInput(true);
           conn.connect();
           InputStream is = conn.getInputStream();

           bmImg = BitmapFactory.decodeStream(is);
           imView.setImageBitmap(bmImg);
      } catch (IOException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
      }
 }

Source : http://en.androidwiki.com/wiki/Loading_images_from_a_remote_server

See this too

http://ballardhack.wordpress.com/2010/04/05/loading-remote-images-in-a-listview-on-android/

gtiwari333
  • 24,554
  • 15
  • 75
  • 102
2

You need to use custom Adapter for Listview to bind text with image as list item. Refer the below links: Lazy load of images in ListView http://negativeprobability.blogspot.com/2011/08/lazy-loading-of-images-in-listview.html

Community
  • 1
  • 1
Senthil Mg
  • 3,301
  • 4
  • 32
  • 49