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

socket  =  null;
                                } else  {

                                    instream=
                                    new DataInputStream(socket.getInputStream());

                                    new Thread(new  Runnable()  {
                                        @Override
                                        public  void run()  {

                                            try {
                                                mRunning = true;

                                                while (mRunning)  {
                                                    Log.d("",  "mytest  onStart  4");
                                                    sig = instream.read();






                                                    if  (sig==1)  {
                                                         //만약  신호(도난)가  왔다면
                                                        mHandler.sendEmptyMessage(0);

                                                        sig = 0;
                                                    }

                                                }
                                            } catch (Exception  e) {
                                                Log.d("",  "mytest  onClose  2");

                                                e.printStackTrace();
                                            }

                                        }
                                     }).start();
                                }

                            } catch (Exception  e) {
                                Log.d("",  "mytest  onClose  1");

                                e.printStackTrace();
                            }
                        }

                     }).start();







                                                         -  474  -
   476   477   478   479   480   481   482   483   484   485   486