title: Saving picture gives FileNotFoundException ()
body: <p>I'm new to android camera API , there's a <em>PictureCallback</em> invoked in the code with :</p>
  
  <pre><code>     PictureCallback jpegCallback = new PictureCallback() {
            public void onPictureTaken(byte[] data, Camera camera) {
               // Save the image JPEG data to the SD card
               FileOutputStream outStream = null;
               try {
                  String path = Environment.getExternalStorageDirectory() +"\test.jpg";
  
              outStream = new FileOutputStream(path);
              outStream.write(data);
              outStream.close();
           } catch (FileNotFoundException e) {
              Log.e(TAG, "File Note Found", e);
           } catch (IOException e) {
              Log.e(TAG, "IO Exception", e);
           }
        }
     };
  </code></pre>
  
  <p>The exception pointed out to this line :</p>
  
  <pre><code>outStream = new FileOutputStream(path);
  </code></pre>
  
  <p>Since I'm new to Android world, I don't know where's exactly this <em>Environment.getExternalStorageDirectory()</em> points out.  </p>
  
  <p>The exception says :</p>
  
  <blockquote>
    <p>Java.io.FileNotFoundException: /storage/emulated/0    est.jpg: open
    failed: EACCES (Permission denied)</p>
  </blockquote>
  
  <p>But in my manifest :</p>
  
  
  
  <pre><code>&lt;uses-feature android:name="android.hardware.Camera"/&gt;
     &lt;uses-permission android:name="android.permission.CAMERA"/&gt;
  </code></pre>
  
  <p>EDIT : I fixed the path to </p>
  
  <p><code>String path = Environment.getExternalStorageDirectory() +"/test.jpg";</code></p>
  
  <p>But still gives me :</p>
  
  <blockquote>
    <p>java.io.FileNotFoundException: /storage/emulated/0/test.jpg: open
    failed: EACCES (Permission denied)</p>
  </blockquote>