title: Why and how to use the @xml/file_paths resource in Android Studio?
body: <p><strong>tl;dr:</strong> Why do I need a file_paths resource, when I retrieve a file_path dynamically during runtime?</p>
  
  <p>I am currently learning Android Studio by building my own app.
  What I want to do right now is to take a picture and then get some Text out of it.
  To take a picture and use it lateron, I followed the <a href="https://developer.android.com/training/camera/photobasics.html" rel="noreferrer">Taking Photos Simply</a> guide of the Android Developers. At this point, it is suggested to use a <a href="https://developer.android.com/reference/android/support/v4/content/FileProvider.html#SpecifyFiles" rel="noreferrer">File Provider</a>. </p>
  
  <p>In the manifest, the File Provider is added like this:</p>
  
  <pre><code>&lt;provider
      android:name="android.support.v4.content.FileProvider"
      android:authorities="com.mydomain.fileprovider"
      android:exported="false"
      android:grantUriPermissions="true"&gt;
      &lt;meta-data
          android:name="android.support.FILE_PROVIDER_PATHS"
          android:resource="@xml/file_paths" /&gt;
  &lt;/provider&gt;
  </code></pre>
  
  <p>I am struggling with the <code>meta-data</code>, especially the <code>android:resource=@xml/file_paths"</code></p>
  
  <p>In the <em>Taking Photos Simply Tutorial</em>, this is the required addition to the XML to make it work:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;paths xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;external-path name="my_images" path="Android/data/com.example.package.name/files/Pictures" /&gt;
  &lt;/paths&gt;
  </code></pre>
  
  <p>So my question is: What is the good practise intended within the developer guide that I should follow, and how do I do that?</p>
  
  <p>Edit: To make things clearer, I am having trouble understanding how to use a resource here at all.
  This is the method code straigh out of the guide:</p>
  
  <pre><code>private File createImageFile() throws IOException {
          // Create an image file name
          String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
          String imageFileName = "JPEG_" + timeStamp + "_";
          File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
          File image = File.createTempFile(
                  imageFileName,  /* prefix */
                  ".jpg",         /* suffix */
                  storageDir      /* directory */
          );
  
          // Save a file: path for use with ACTION_VIEW intents
          currentPhotoPath = image.getAbsolutePath();
          return image;
      }
  </code></pre>
  
  <p>So I am dynamically getting the name of the file (and therefore it's file path) during the Runtime of my application.
  What is that file/paths for, I do not understand its usage.</p>