Code example for Random

Methods: nextInt

0
            if (server1 != null) mXtraServers[count++] = server1;
            if (server2 != null) mXtraServers[count++] = server2;
            if (server3 != null) mXtraServers[count++] = server3;
 
            // randomize first server 
            Random random = new Random();
            mNextServerIndex = random.nextInt(count);
        }        
    } 
 
    byte[] downloadXtraData() { 
        String proxyHost = Proxy.getHost(mContext);
        int proxyPort = Proxy.getPort(mContext);
        boolean useProxy = (proxyHost != null && proxyPort != -1);
        byte[] result = null;
        int startIndex = mNextServerIndex;
 
        if (mXtraServers == null) {
            return null; 
        }