Creating and Displaying Image Using Streaming contents

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Creating and Displaying Image Using Streaming contents

Postby Katharnavas » Thu Jan 03, 2008 8:15 am

Hi,
Whats the best procedure for creating and displaying an image from a remote URL.. Im able to get the image contents through connection but im quite confused of displaying it in a view.. Any suggestions please..
Katharnavas
Senior Developer
Senior Developer
 
Posts: 100
Joined: Tue Dec 04, 2007 5:57 am
Location: India

Top

Postby plusminus » Thu Jan 03, 2008 1:58 pm

Hello Katharnavas,

this has already been done in the :src: Weather-Forecast.
Excerpt:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                URLConnection conn = aURL.openConnection();
  2.  
  3.                conn.connect();
  4.  
  5.                InputStream is = conn.getInputStream();
  6.  
  7.                BufferedInputStream bis = new BufferedInputStream(is);
  8.  
  9.                Bitmap bm = BitmapFactory.decodeStream(bis);
  10.  
  11.                bis.close();
  12.  
  13.                is.close();
  14.  
  15.                this.myWeatherImageView.setImageBitmap(bm);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Katharnavas » Thu Jan 03, 2008 2:00 pm

Hi,
Sorry i really missed that ... ok i will look in to it..
Katharnavas
Senior Developer
Senior Developer
 
Posts: 100
Joined: Tue Dec 04, 2007 5:57 am
Location: India

Top

Return to General

Who is online

Users browsing this forum: No registered users and 4 guests