What is an OTP number in a login authentication system? Is there any specific algorithm for generating OTP numbers using java (android). Or is an OTP something like random n
Easiest way is to just use DecimalFormat with Random class.
String otp= new DecimalFormat("000000").format(new Random().nextInt(999999)); System.out.println(otp);
Sample Outputs,
002428 445307 409185 989828 794486 213934