I am trying to make an app that takes a photo and displays it using emulator instead of a device. I followed the steps from this [android doc](https://developer.android.com/training/camera/photobasics.html):

Part 1) Here is my code where it gets stucks : `file = FileProvider.getUriForFile(this, "edu.android.notetakingapplication.provider", createFileDir());` 

This part is in the Mainxml

```
    if (!mediaStorageDir.exists()){
        if (!mediaStorageDir.mkdirs()){
            Log.d("NoteTaking", "failed to create directory");
            return null;
        }
    }

    String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
    return new File(mediaStorageDir.getPath() + File.separator +
            "IMG_"+ timeStamp + ".jpg");
}

```

Here is my app manifest file's provider section

```
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="edu.android.notetakingapplication.provider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/provider_paths" />
    </provider>

```

and provider\_paths.xml

```
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="Android/data/edu.android.notetakingapplication/files/Pictures"/>
</paths>

```

Part 2) If i keep provider\_paths as this

```
 <?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="."/>
</paths>

```

I am able to open camera app, take photo and view it on the same page, but, here is the catch, I am storing the path into database and trying to retrieve all the images on a page. Here is when it gives an error:

```
Unable to decode stream: java.io.FileNotFoundException: /external_files/Pictures/NoteTaking/IMG_20170226_230608.jpg (No such file or directory)

```