Here's how I did it...
{other code}...
try{
Bitmap offerImage = getRemoteImage(new
URL(offer.getImageUrl()));
mOfferImageView.setImageBitmap(offerImage);
}catch(MalformedURLException ex){
}
}
public Bitmap getRemoteImage(final URL aURL) {
try {
final URLConnection conn = aURL.openConnection();
conn.connect();
final BufferedInputStream bis = new
BufferedInputStream(conn.getInputStream());
final Bitmap bm = BitmapFactory.decodeStream(bis);
bis.close();
return bm;
} catch (IOException e) {
Log.d("DEBUGTAG", "Oh noooz an error...");
}
return null;
}
On Oct 24, 7:54 pm, [EMAIL PROTECTED] wrote:
> how I can get only images of a website to be displyed on my Android
> Emulator?
>
> java code ==> android
>
> ImageIcon im;
>
> try{
> im = new ImageIcon(new URL("http://mm.mm.com/mm/lg/
> mm.gif"));
> }catch(Exception e) {}
> JLabel jl = new JLabel("Image",im,JLabel.CENTER);
> getContentPane().add(jl);
> setSize(400,400);
> setVisible(true);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---