Android examples for java.util:Random String
get integer number based Random String
import java.util.Random; public class Main { public static String getRandomStr(int num) { StringBuffer temp = new StringBuffer(); Random rand = new Random(); for (int i = 0; i < num; i++) { temp.append(rand.nextInt(10));/*from www . j a v a 2 s . c om*/ } return temp.toString(); } }