title: store images with MediaStore to specific folder
body: <p>I was searching a bit on how to add images using the mediastore since I'm currently doing it manual with </p>
  
  <pre><code>final String myBitmap = "MyImage_"+ mFileDate + ".png";
  File fileNumber = new File(APP_FILE_PATH, myBitmap);
  out = new FileOutputStream( fileNumber );
  final Bitmap mBitmap =getBitmap();
  mBitmap.compress( Bitmap.CompressFormat.PNG, 85, out );
  out.flush();
  </code></pre>
  
  <p>however I need the IDs that media manager uses to store since its easier to manage id rather than paths and such.
  I tried adding it this way:</p>
  
  <pre><code>ContentValues values = new ContentValues();
  values.put(Images.Media.TITLE, mFileName.getName());
  values.put(Images.Media.DESCRIPTION, getString(R.string.bitdraw_description));
  values.put(Images.Media.MIME_TYPE, "image/png");
  
  Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);
  out = getContentResolver().openOutputStream(uri);
  mBitmap.compress( Bitmap.CompressFormat.PNG, 85, out );
  out.flush();
  </code></pre>
  
  <p>however this adds the image to the folder where the photos are saved and not to the specific folder I want to.</p>
  
  <p>Also tried this after the manual (first part):</p>
  
  <pre><code>Media.insertImage(getContentResolver(), mFileName.getPath(), mFileName.getName(), getString(R.string.description));
  </code></pre>
  
  <p>but this only generates duplicates since the image was saved first by the <code>outputStream</code></p>
  
  <p>A workaround I found on a thread here is to call a broadcast like this: </p>
  
  <p><code>sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse    ("file://"+ Environment.getExternalStorageDirectory())));</code></p>
  
  <p>but this is rather inneficient and takes long, and I want it to be the fastest, and I'm quite unsure if this actually generates the IDs, and if it does, how could I make this to scan only a specific folder in the SD ??
  Any help would be appreciated.</p>