Android examples for java.util:Random Double
random Float
import java.util.Random; import android.os.SystemClock; public class Main{ private static final Random mRandom; public static float randomFloat(float maximum) { return mRandom.nextFloat() * maximum; }// ww w.j a va 2 s . c o m public static float randomFloat(float minimum, float maximum) { return randomFloat(maximum - minimum) + minimum; } }