code: public static File createPictureFile(Context context) throws IOException {
          Locale locale = Locale.getDefault();
          String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", locale).format(new Date());
          String fileName = "JPEG_" + timeStamp + "_";
          // Store in normal camera directory
          File storageDir = context.getExternalFilesDir(Environment.DIRECTORY_PICTURES);
          return File.createTempFile(fileName, ".jpg", storageDir);
      }
docs: Create a file with a path appropriate to save a photo. Uses directory internal to app.