Page 565 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 565

Log.d(TAG, "...Send  data:  "  +  message + "...");

                       try  {

                            mmOutStream.write(msgBuffer);


                       }  catch  (IOException e)  {

                            String  msg  =  "In  onResume() and  an  exception  occurred during  write: " +

                                                                                                             e.getMessage();

                            if  (address.equals("00:00:00:00:00:00"))

                                 msg  =  msg  +  ".\n\nUpdate  your  server  address  from  00:00:00:00:00:00

            to  the correct address  on  line 35  in the  java  code";

                            msg = msg  +    ".\n\nCheck  that the SPP  UUID:  "  +

                                                       MY_UUID_SECURE.toString()  +  "  exists  on  server.\n\n";

                            errorExit("Fatal  Error",  msg);


                       }

                 }

                 public  void errorExit(String  title, String  message){

                       Toast.makeText(getBaseContext(),  title + " - " + message,

                                                                                    Toast.LENGTH_LONG).show();


                       finish();

                 }

                    public  BluetoothTestService(Context  context,  Handler  handler)  {

                            mAdapter  =  BluetoothAdapter.getDefaultAdapter();

                       mState = STATE_NONE;


                       mHandler  =  handler;

                 }

                 public  synchronized void  start()  {

                       // Start the  thread  to listen  on  a BluetoothServerSocket





                                                         -  558  -
   560   561   562   563   564   565   566   567   568   569   570