Android File Name Get getUniqueImageFilename(String prefix)

Here you can find the source of getUniqueImageFilename(String prefix)


get Unique Image Filename


public static String getUniqueImageFilename(String prefix) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static String getUniqueImageFilename(String prefix) {
        String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss")
                .format(new Date());
        String imageFileName = prefix + timeStamp + ".jpg";
        return imageFileName;
    }//from  w w w . j  a va 2s  .  co  m


  1. parseFileName(String path)
  2. getSuffix(File file)
  3. getSuffix(String fileName)
  4. getNamePart(String fileName)
  5. appendNumberToFilenameIfExists(String fileName, File directory)
  6. getFileName()
  7. getFileName(String path)
  8. getFileNameFromURL(String url)
  9. getFileNameFromURL(URL url)