Generate Random Number in Android
1 min readJan 3, 2018
Android gives us Random Java class which gives us pseudo arbitrary esteems. So designer can set esteems restrain in work and create random number will be between them.
Random random = new Random();
int randomNumber = random.nextInt(80–65) + 65;
This gives a random integer number between 65 (inclusive) and 80 (exclusive), one of 65,66,…,78,79.
So the actual usage is
Random random = new Random();
int randomNumber = random.nextInt(max–min) + min;