1 / 16

컴퓨터과학과 2007311034 임재 욱

Smart Mouse. 컴퓨터과학과 2007311034 임재 욱. 1 개발 목적 및 개발 환경 2 서버 구현 (C#) 3 클라이언트 구현 (Android, Java) 4 시연. SmartMouse. 1 개발 목적 및 개발 환경. SmartMouse. 개발 목적 및 개발 환경. 01. 1 개발 목적. 내 용 필요 성 PPT 발표를 할 때 한자리에 서서 발표를 하거나 다른 사람이 PC 를 조작 혹은 별도의 리모컨을 이용하게 된다 .

Download Presentation

컴퓨터과학과 2007311034 임재 욱

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Smart Mouse 컴퓨터과학과 2007311034 임재욱

  2. 1 개발 목적 및 개발 환경 2 서버 구현 (C#) 3 클라이언트 구현 (Android, Java) 4 시연 • SmartMouse

  3. 1 개발 목적 및 개발 환경 • SmartMouse

  4. 개발 목적 및 개발 환경 01 1 개발 목적 • 내용 • 필요성 • PPT 발표를 할 때 한자리에 서서 발표를 하거나 다른 사람이 PC를 조작 혹은 별도의 리모컨을 이용하게 된다. • 거의 모든 사람들이 스마트폰을 사용하는 요즘 간단한 프로그램과 어플리케이션 실행으로 스마트폰을 마우스처럼 사용할 수 있도록 구현해 보았다. • 구현 내용 • 안드로이드스마트폰의 터치센서, 자이로 센서, 가속 센서, 중력센서 등을 이용하여 마우스를 제어할 수 있도록 구현하였다. • 연결의 경우 WiFi혹은 인터넷을 통하여 구현하였다.

  5. 개발 목적 및 개발 환경 01 2 개발 환경 • 내용 • Windows8 x64 • VisualStudio 2012 • .NET Framework 2.0 • ADT (Android Developer Tools) v21.1.0 • 안드로이드SDK 4.2 API LEVEL : 17 • 옵티머스G 4.1.2 • TCP/IP 100M급 Internet (WiFi환경) • 개발 언어 • C#, Android(Java, XML)

  6. 2 서버 구현 (C#) • SmartMouse

  7. 서버 구현 (C#) 02 처음 돌아가는 함수인 WaitingSocket()에서 시작된 BeginAccept가 Accept 되면 EndAccept가진행되고 BeginReceive가 시작됨 AcceptReceiveCallback에서 시작된 BeginReceive가 메시지를 받게되면EndReceive가 진행되고 MouseEvent를 처리 후 다시 BeginReceive가 시작됨

  8. 서버 구현 (C#) 104 public void CallBack_ReceiveMsg(IAsyncResultar) 105 { 106 int length; 107 getString = null; 108 109 Client = (Socket)ar.AsyncState; 110 111 try 112 { 113 length = Client.EndReceive(ar); 114 if (length > 0) 115 { 116 getString = Encoding.UTF8.GetString(getByte, 0, length); 117 if (getString != String.Empty) 118 { 119 // 폰에서 전송한 내용 처리 시작 (실제 마우스 입력 되도록) 120 ControlMouse(); 121 } 122 Client.BeginReceive(getByte, 0, getByte.Length, SocketFlags.None, new AsyncCallback(CallBack_ReceiveMsg), Client); 123 } 124 else 125 { 126 if (Server != null) 127 Server.Close(); 128 if (Client != null) 129 Client.Close(); 130 ad = new clientAcceptDelegate(initClientIP); 131 this.Invoke(ad); 132 WaitingSocket(); 133 } 134 } 135 catch (ObjectDisposedExceptionobje) 136 { 137 } 138 catch (SocketException se) 139 { 140 } 141 catch (Exception e) 142 { 143 } 144 } 02 소스 코드 80 public void AcceptReceiveCallback(IAsyncResultar) 81 { 82 Server = (Socket)ar.AsyncState; 83 try 84 { 85 Client = Server.EndAccept(ar); 86 ad = new clientAcceptDelegate(getClientIP); 87 this.Invoke(ad); 88 Client.BeginReceive(getByte, 0, getByte.Length, SocketFlags.None, new AsyncCallback(CallBack_ReceiveMsg), Client); 89 } 90 catch (ObjectDisposedException e) 91 { 92 //MessageBox.Show(e.ToString()); 93 } 94 catch (SocketException se) 95 { 96 //MessageBox.Show(se.ToString()); 97 } 98 catch (Exception e) 99 { 100 //MessageBox.Show(e.ToString()); 101 } 102 }

  9. 서버 구현 (C#) 02 소스 코드 146 void WaitingSocket() 147 { 148 IPAddressserverIP = IPAddress.Any; 149 IPEndPointserverEndPoint = new IPEndPoint(serverIP, serverPort); 150 151 152 try 153 { 154 Server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType. Tcp); 155 Server.Bind(serverEndPoint); 156 Server.Listen(10); 157 158 Server.BeginAccept(new AsyncCallback(AcceptReceiveCallback), Server); 159 } 160 catch (SocketExceptionsocketEx) 161 { 162 // MessageBox.Show("네트워크 에러입니다.₩n" + socketEx.ToString()); 163 } 164 catch (Exception commonEx) 165 { 166 // MessageBox.Show("시스템 에러입니다.₩n" + commonEx.ToString()); 167 } 168 169 }

  10. 서버 구현 (C#) 02 실행 화면 어플리케이션 실행 전 어플리케이션 실행 후

  11. 3 클라이언트 구현 (Android, Java) • SmartMouse

  12. 클라이언트 구현 03 안드로이드 구동 원리 Process Application Activity BroadCast Receiver Content Provider Service

  13. 클라이언트 구현 03

  14. 클라이언트 구현 03 실행 화면 로딩 화면 연결 뒤 화면 연결 전 화면

  15. 4 시연 • SmartMouse

  16. 감사합니다

More Related