After downloading images it saves them to this location
String extStorageDirectory;
protected void onCreate(Bundle icicle) {
extStorageDirectory = Environment.getExternalStorageDirectory().toString(); //set it to the SD card directory
}
public void savetoSD(Integer Index) //Index is what pic number it is 1 through 9
{
OutputStream outStream = null;
String filename = "Hentai" + System.currentTimeMillis() + ".JPEG";
String filepath = extStorageDirectory + "/media/pictures/MyAppsDownloadFolder/" + filename;
File file = new File(filepath);
try {
outStream = new FileOutputStream(file);
//get a download here for the real bitmap
DownloadFromUrl(myMainPicURL[Index],filename);
Bitmap saveME = null;
saveME = BitmapFactory.decodeFile(PATH+filename);
saveME.compress(Bitmap.CompressFormat.JPEG, 100, outStream);
outStream.flush();
outStream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//need to refresh the damned MediaScanner
try {
MediaStore.Images.Media.insertImage(getContentResolver(), filepath, filename, "myDownloadedPics");
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
message_user("Saved as " + filepath);
}
I believe the mediastore doesnt work or i dont know how to use it please help
I want the downloaded images to appear in the gallery or atleast have the folder MyAppsDownloadFolder to show in the gallery which it doesnt!
The media scanner does not automatically scan the SD card, except when the device is turned on or the SD card is unmounted from the host PC.
If you want the media scanner to specifically do a scan on demand, use
MediaScannerConnection.