package de.stephanlindauer.criticalmaps.utils;

import android.os.Environment;

import java.io.File;
import java.util.UUID;

public class ImageUtils {

    private ImageUtils() {}

    public static File getNewOutputImageFile() {
        File mediaStorageDir = new File(
                Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),
                "CriticalMaps");

        if (!mediaStorageDir.exists() && !mediaStorageDir.mkdirs()) {
            return null;
        }

        final String id = UUID.randomUUID().toString().replace("-", "");
        return new File(mediaStorageDir.getPath() + File.separator + id + ".jpg");
    }
}

@@ -110,17 +110,77 @@
 ava.
-util.UUID
+text.SimpleDateFormat;%0Aimport java.util.Date;%0Aimport java.util.Locale
 ;%0A%0Ap
@@ -584,58 +584,175 @@
 ing 
-id = UUID.randomUUID().toString().replace(%22-%22, %22%22)
+timestamp =%0A                new SimpleDateFormat(%22yyyyMMdd-HHmmss%22, Locale.US).format(new Date());%0A        final String filename = %22CriticalMaps-%22 + timestamp + %22.jpg%22
 ;%0A  
@@ -822,19 +822,16 @@
 r + 
-id + %22.jpg%22
+filename
 );%0A 

Change photo filenames