title: Creating Directory in Android API 22(Lollipop) and 23(Marshmallow)
body: <p>I am developing an android application that require files(images) to be saved on the devices in order to access them later. I need to create a directory(folder) and then put this stuffs(images) in it
  I have this code running on API 19(Kitkat) but does not work on lollipop and the latest marshmallow. </p>
  
  <p>Codes</p>
  
  <pre><code> String stored = null;
  
      File sdcard = Environment.getExternalStorageDirectory() ;
  
  
      File folder = new File(sdcard.getAbsoluteFile() , "PropertyImages");
  
      Log.i("Folder Name",folder.toString());
      if (folder.exists()){
          Log.w("Folder Exist","Folder Exists");
      }else{
          Log.w("Folder NOT Exist","Folder NOT Exist");
      }
  
      if (folder.mkdir()){
          Log.w("Folder Created","Folder Created");
      }else{
          Log.w("Folder is NOT Created","Folder is NOT  Created");
      }
  
      File file = new File(folder.getAbsoluteFile(), filename + ".jpg") ;
      if (file.exists())
          return stored ;
  
      try {
          FileOutputStream out = new FileOutputStream(file);
          bitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
          out.flush();
          out.close();
          stored = "success";
      } catch (Exception e) {
          e.printStackTrace();
      }
      return stored;
  }
  </code></pre>
  
  <p>In Kitkat it Worked. In Lollipop and Above it Gives File Not Created</p>
  
  <p>Manifest</p>
  
  <pre><code> &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  </code></pre>