Android Utililty Methods Password Create

List of utility methods to do Password Create

Description

The list of methods to do Password Create are organized into topic(s).

Method

StringgenerateRandomPassword(int length)
generate Random Password
StringBuffer sb = new StringBuffer(length);
for (int i = 0; i < length; i++) {
    int index = (int) (RANDOM.nextDouble() * RANDOM_LETTERS.length);
    sb.append(RANDOM_LETTERS[index]);
return sb.toString();
StringgeneratePassword()
generate Password
int randomInt = new Random().nextInt(1000000);
return String.valueOf(randomInt);
StringgenerateUsername()
generate Username
int randomInt = new Random().nextInt(1000000);
String username = String.valueOf(randomInt);
int len = username.length();
while (len < 6) {
    username = "0" + String.valueOf(randomInt);
    len = username.length();
return username;
...