Page 82 - MDP2022-2
P. 82
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
mThreadConnectedBluetooth.write("x");
}
}
});
mBluetoothHandler = new Handler() {
public void handleMessage(android.os.Message msg) {
if (msg.what == BT_MESSAGE_READ) {
String readMessage = null;
try {
readMessage = new String((byte[]) msg.obj, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
mTvReceiveData.setText(readMessage);
}
}
};
}