Code example for BluetoothSocket

Methods: getInputStream, getOutputStream, getRemoteDevice

0
        } 
    } 
 
    public void receiveConnection(BluetoothSocket socket) throws IOException { 
        this.bluetoothSocket = socket; 
        this.bluetoothDevice = socket.getRemoteDevice(); 
        server = new BangBangServer(bluetoothSocket.getInputStream(), bluetoothSocket.getOutputStream(), this); 
    } 
 
    private final BroadcastReceiver mReceiver = new BroadcastReceiver() { 
 
        public void onReceive(Context context, Intent intent) { 
            String action = intent.getAction(); 
            Log.i(getClass().getSimpleName(), "mReceiver_action:"+ action); 
            // When discovery finds a device 
            if (BluetoothDevice.ACTION_FOUND.equals(action)) { 
                // Get the BluetoothDevice object from the Intent 
                BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); 
                deviceMap.put(device.getAddress(),device); 
                onDeviceFound(device);