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);
                                            }
                                    }
                            };

                    }
   77   78   79   80   81   82   83   84   85   86   87