JeffMeJones JMJ applications
save file = https://www.dropbox.com/s/gvz4v7ra3w7...
public void SaveImage(Context context,Bitmap ImageToSave)
TheThis = context;
String file_path = Environment.getExternalStorageDirectory().getAbsolutePath()+ NameOfFolder;
String CurrentDateAndTime= getCurrentDateAndTime();
File dir = new File(file_path);
if(!dir.exists())
dir.mkdirs();
File file = new File(dir, NameOfFile +CurrentDateAndTime+ ".jpg");
try
FileOutputStream fOut = new FileOutputStream(file);
ImageToSave.compress(Bitmap.CompressFormat.JPEG, 85, fOut);
fOut.flush();
fOut.close();
MakeSureFileWasCreatedThenMakeAvabile(file);
AbleToSave();
catch (FileNotFoundException e) UnableToSave();
catch (IOException e)UnableToSave();
private void MakeSureFileWasCreatedThenMakeAvabile(File file)
MediaScannerConnection.scanFile(TheThis,
new String[] file.toString() , null,
new MediaScannerConnection.OnScanCompletedListener()
public void onScanCompleted(String path, Uri uri)
private String getCurrentDateAndTime()
Calendar c = Calendar.getInstance();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
String formattedDate = df.format(c.getTime());
return formattedDate;
private void UnableToSave()
Toast.makeText(TheThis, "Picture cannot to gallery", Toast.LENGTH_SHORT).show();
private void AbleToSave()
Toast.makeText(TheThis, "Picture saved be saved", Toast.LENGTH_SHORT).show();
On this page of the site you can watch the video online Android Java - Tutorial - Save Image Into Gallery with a duration of hours minute second in good quality, which was uploaded by the user Jeff Jones 10 April 2013, share the link with friends and acquaintances, this video has already been watched 32,272 times on youtube and it was liked by 88 viewers. Enjoy your viewing!