Code example for BluetoothSocket

Methods: getInputStream, getOutputStream, getRemoteDevice

0
    public class UpdateThread implements Runnable {
        private boolean sensorinitialized = false;
 
        public UpdateThread() { 
            if (mBluetoothSocket != null) {
                devicename = mBluetoothSocket.getRemoteDevice().getName();
                deviceadress = mBluetoothSocket.getRemoteDevice().getAddress();
                boolean gelukt = (new OBD2SensorRegistrator(context)).verifySensorIds(devicename,
                        deviceadress);
                Log.v(TAG, "HOI is het gelukt? " + gelukt);
                Log.v(TAG, "HALLO1 devicename: " + devicename + ", deviceadress: " + deviceadress);
                if (mmInStream == null || mmOutStream == null) {
                    try { 
                        mmInStream = mBluetoothSocket.getInputStream();
                        mmOutStream = mBluetoothSocket.getOutputStream();
                    } catch (Exception e) {
                        Log.e(TAG, "Error in UpdateThread constructor:" + e.getMessage());
                    } 
                } 
            } else { 
                Log.e(TAG,