Hi all,
Sorry if this is a re-post. I tried to find the solution here but
failed.
I made a small app which downloads an image(jpg) and saves it on the
sd card. It works fine. I could pull the image down in to my computer
and could see it.
But i couldnt see it in the emulator. (not appearing in the gallery)..
Why is that?
private void testDownload(String urlStr) {
URL url = null;
try {
url = new URL(urlStr);
URLConnection conn = null;
conn = url.openConnection();
conn.connect();
InputStream is = null;
is = conn.getInputStream();
BufferedInputStream bis = new BufferedInputStream(is);
Bitmap bm = BitmapFactory.decodeStream(bis);
File f = new File("/sdcard/1.jpg");
FileOutputStream fos = null;
fos = new FileOutputStream(f);
bm.compress(Bitmap.CompressFormat.JPEG, 100, fos);
bis.close();
is.close();
} catch (IOException e) {
Log.e(TAG, "error6:" + e.toString());
}
}
Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---