Generate Photo File Name by Date - Android Camera

Android examples for Camera:Photo

Description

Generate Photo File Name by Date

Demo Code


//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String getPhotoFileName() {
        Date date = new Date(System.currentTimeMillis());
        SimpleDateFormat dateFormat = new SimpleDateFormat(
                "'IMG'_yyyyMMdd_HHmmss");
        return dateFormat.format(date) + ".jpg";
    }//from w  w w.j  ava2s.com
}

Related Tutorials