Code example for Random

Methods: nextBytes

0
            mServiceUuid = serviceUuid;
            mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
            if (mBluetoothAdapter == null) {
                throw new IllegalStateException("No Bluetooth adapter found.");
            } 
            Random random = new Random();
            mCollisionResolution = new byte[2];
            random.nextBytes(mCollisionResolution);
 
            mAcceptThread = new AcceptThread();
            mChannel = mAcceptThread.getListeningPort();
            mAcceptThread.start();
        } 
 
        public BluetoothConnecting(OnConnectedListener onBtConnected) {
            this(onBtConnected, false, UUID.randomUUID());
        } 
 
        private NdefMessage getHandoverRequestMessage(Context context) {
            NdefRecord[] records = new NdefRecord[4];