Android Network State Check loadImageFromNetwork(String photoUrl)

Here you can find the source of loadImageFromNetwork(String photoUrl)

Description

load Image From Network

Declaration

public static Bitmap loadImageFromNetwork(String photoUrl) 

Method Source Code

//package com.java2s;
import java.io.InputStream;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import android.util.Log;

public class Main {
    public static Bitmap loadImageFromNetwork(String photoUrl) {
        Bitmap bm = null;//ww  w.j  av a2  s  .c  o m
        try {
            InputStream in = new java.net.URL(photoUrl).openStream();
            bm = BitmapFactory.decodeStream(in);
        } catch (Exception e) {
            Log.e("Error", e.getMessage());
            e.printStackTrace();
        }
        return bm;
    }
}

Related

  1. isNetworkAvailableExt(Context paramContext)
  2. isNetworkAvailable(Context context)
  3. getNetworkState(Context context)
  4. isLocationEnabledNetwork(Context c)
  5. isOpenNetwork(Context context)
  6. IsInternetReachable()
  7. setMobileDataEnabled(Activity a, Context context, boolean enabled)
  8. isNetworkAvailable(Activity mainActivity)
  9. isDeviceOnline(Activity activity)