Here you can find the source of getRandomByte()
public static byte getRandomByte()
//package com.java2s; import java.util.Random; import android.util.Log; public class Main { public static byte getRandomByte() { byte randomNum = 0; Random random = new Random(); int num = Math.abs(random.nextInt() % 256); randomNum = (byte) num; Log.d("", "--> getRandomNum num : " + num + " , randomNum : " + (randomNum & 0xFF)); return randomNum; }/*from w ww . java 2 s.c o m*/ }