Android Password Create generateUsername()

Here you can find the source of generateUsername()

Description

generate Username

Declaration

private static String generateUsername() 

Method Source Code

//package com.java2s;

import java.util.Random;

public class Main {
    private static String generateUsername() {
        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();/*from w  ww .j  a  v  a2 s  . c  om*/
        }

        return username;
    }
}

Related

  1. generateRandomPassword(int length)
  2. generatePassword()