app/src/main/java/com/example/iamatourist/MainActivity.java
private File makeImageFile() throws IOException {
        String fileName = "TempImage";
        File StorageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), ("/TouristApp/" + currentTrip.getTitle()));
        StorageDir.mkdirs();
        File image = File.createTempFile(
                fileName, ".jpg", StorageDir
        );
        saveLoc = "file:" + image.getAbsolutePath();
        return image;
    }
/**
     * This method is also sourced from:
     * https://inthecheesefactory.com/blog/how-to-share-access-to-file-with-fileprovider-on-android-nougat/en
     * <p>
     * Its purpose is to create a temporary file where the image is saved.
     * The child of the base DCIM directory is name of the app, followed by the trip name.
     *
     * @return Returns the image save location as a File
     * @throws IOException
     */


@return Returns the image save location as a File
@throws IOException
@return Returns the image save location as a File @throws IOException
private File makeImageFile() throws IOException {
        String fileName = "TempImage";
        File StorageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), ("/TouristApp/" + currentTrip.getTitle()));
        StorageDir.mkdirs();
        File image = File.createTempFile(
                fileName, ".jpg", StorageDir
        );
        saveLoc = "file:" + image.getAbsolutePath();
        return image;
    }
private File makeImageFile ( ) throws IOException { String fileName = "TempImage" ; File StorageDir = new File ( Environment . getExternalStoragePublicDirectory ( Environment . DIRECTORY_DCIM ) , ( "/TouristApp/" + currentTrip . getTitle ( ) ) ) ; StorageDir . mkdirs ( ) ; File image = File . createTempFile ( fileName , ".jpg" , StorageDir ) ; saveLoc = "file:" + image . getAbsolutePath ( ) ; return image ; }
This method is also sourced from:
 https://inthecheesefactory.com/blog/how-to-share-access-to-file-with-fileprovider-on-android-nougat/en
 <p>
 Its purpose is to create a temporary file where the image is saved.
This method is also sourced from : https : // inthecheesefactory . com / blog / how - to - share - access - to - file - with - fileprovider - on - android - nougat / en <p > Its purpose is to create a temporary file where the image is saved .