When you close or stop your app,you should call this method.This is working for me for both 4.4 as well as lower android sdk version.
import android.media.MediaScannerConnection;
public void addImageIntoGallery() {
String version = Build.VERSION.RELEASE;
if(! version.contains("4.4")){
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_MOUNTED);
String mCurrentPhotoPath = "file://" + Environment.getExternalStorageDirectory()+"/myDirectory";
File file = new File(mCurrentPhotoPath);
Uri contentUri = Uri.fromFile(file);
mediaScanIntent.setData(contentUri);
sendBroadcast(mediaScanIntent);
}else{
MediaScannerConnection.scanFile(this, new String[] { Environment.getExternalStorageDirectory().toString() }, null, new MediaScannerConnection.OnScanCompletedListener() {
public void onScanCompleted(String path, Uri uri)
{
Log.i("ExternalStorage", "Scanned " + path + ":");
Log.i("ExternalStorage", "-> uri=" + uri);
Log.i(TAG, "Scanned ................" + path);
}
});
}
}
@Override
protected void onPause() {
addImageIntoGallery();
super.onPause();
}
OR
Save them into the right place on the SDCard. BlackBerry devices mount the SDCard at /SDCard, so the full path would be /SDCard/BlackBerry/pictures/
You can also create a subdirectory in the pictures directory, which will organize the photos when viewed from the photo gallery app.
Devices have built-in storage as well, though the capacity is substantially smaller than most SDCards. To save pictures there, use the path /store/home/user/pictures/
if this does not help then view this article http://docs.phonegap.com/en/edge/cordova_file_file.md.html#File
or this Phonegap - Save image from url into device photo gallery