This is a method for Download image from server and display image in Imageview.
More Ref Links:
http://www.coderzheaven.com/2012/04/26/upload-image-android-device-server-method-4/
http://androidsnips.blogspot.in/2010/08/upload-file-to-remote-server-in-android.html
http://rorraja.blogspot.in/2012/05/upload-image-on-server-in-android.html
http://vikaskanani.wordpress.com/2011/01/29/android-image-upload-activity/
public void DownloadImageFromServer(final String imgurl)
{
new Thread(new Runnable()
{
public void run()
{
try
{
final Bitmap bitmap = BitmapFactory.decodeStream((InputStream) new URL(imgurl).getContent());
imgView.post(new Runnable()
{
@Override
public void run()
{
if(bitmap !=null)
{
imgView.setImageBitmap(bitmap);
}
}
});
}
catch (Exception e)
{}
}
}).start();
}
More Ref Links:
http://www.coderzheaven.com/2012/04/26/upload-image-android-device-server-method-4/
http://androidsnips.blogspot.in/2010/08/upload-file-to-remote-server-in-android.html
http://rorraja.blogspot.in/2012/05/upload-image-on-server-in-android.html
http://vikaskanani.wordpress.com/2011/01/29/android-image-upload-activity/
No comments:
Post a Comment