Back to project page YahooWeather.
The source code is released under:
GNU General Public License
If you think the Android project YahooWeather listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.imlongluo.weather.apis; /*from ww w.ja v a2 s .co m*/ import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import android.graphics.Bitmap; import android.graphics.BitmapFactory; class ImageUtils { public static Bitmap getBitmapFromWeb(String src) { YahooWeatherLog.d("getBitmapFromWeb, src=" + src); try { URL url = new URL(src); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoInput(true); connection.connect(); InputStream input = connection.getInputStream(); Bitmap myBitmap = BitmapFactory.decodeStream(input); return myBitmap; } catch (IOException e) { YahooWeatherLog.printStack(e); return null; } } }