Java tutorial
//package com.java2s; import java.util.Random; public class Main { public static String getRandomFileName() { String _df = android.text.format.DateFormat.format("MMddyyyyhhmmss", new java.util.Date()).toString(); Random r = new Random(); int random = Math.abs(r.nextInt() % 100); return String.format("%d%s.jpg", random, _df); } }