Android examples for java.util:Random
get Random Id Bytes
//package com.java2s; import java.util.Random; public class Main { private static byte[] getRandomIdBytes() { Random rand = new Random(System.currentTimeMillis()); byte buf[] = new byte[4]; rand.nextBytes(buf);//w ww . j a v a 2 s. c o m return buf; } }