title: when to use FileProvider in android studio ...totally beginner programmer
body: <p>i am trying to get knowledge in android studio to make apps so if found this code snippet .</p>
  
  <pre><code>enter code herestatic final int REQUEST_TAKE_PHOTO = 1;
  private void dispatchTakePictureIntent() {
  Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  // Ensure that there's a camera activity to handle the intent
  if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
      // Create the File where the photo should go
      File photoFile = null;
      try {
          photoFile = createImageFile();
      } catch (IOException ex) {
          // Error occurred while creating the File
          ...
      }
      // Continue only if the File was successfully created
      if (photoFile != null) {
          Uri photoURI = FileProvider.getUriForFile(this,
                                                "com.example.android.fileprovider",
                                                photoFile);
          takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
          startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I understand almost all the code but i just confused with "FileProvider" !!
  what is it ? and when we use it ? </p>