Page 76 - MDP2022-2
P. 76

import  android.Manifest;
            import  android.bluetooth.BluetoothAdapter;
            import  android.bluetooth.BluetoothDevice;
            import  android.bluetooth.BluetoothSocket;

            import  android.content.BroadcastReceiver;
            import  android.content.Context;
            import  android.content.DialogInterface;
            import  android.content.Intent;
            import  android.content.IntentFilter;

            import  android.content.pm.PackageManager;
            import  android.os.Bundle;
            import  android.os.Handler;
            import  android.os.SystemClock;
            import  android.util.Log;
            import  android.view.View;

            import  android.widget.AdapterView;
            import  android.widget.ArrayAdapter;
            import  android.widget.Button;
            import  android.widget.EditText;

            import  android.widget.ListView;
            import  android.widget.TextView;
            import  android.widget.Toast;


            import  java.io.IOException;
            import  java.io.InputStream;

            import  java.io.OutputStream;
            import  java.io.PipedInputStream;
            import  java.io.UnsupportedEncodingException;
            import  java.lang.reflect.Method;

            import  java.util.ArrayList;
            import  java.util.List;
            import  java.util.Set;
            import  java.util.UUID;


            public  class  MainActivity  extends  AppCompatActivity  {



                    TextView  mTvBluetoothStatus;
                    TextView  mTvReceiveData;
                    Button  mBtnBluetoothOn;

                    Button  mBtnBluetoothOff;
                    Button  mBtnConnect;
   71   72   73   74   75   76   77   78   79   80   81