0
GPRS를 통해 GSM 모뎀에서 데이터 패킷을 받아야합니다. 어떤 방법으로 보내고받을 수 있습니까? 어떤 프로토콜을 사용해야합니까?안드로이드 모바일에서 GPRS로 데이터 패킷을 수신하려면 어떻게해야합니까?
GPRS를 통해 GSM 모뎀에서 데이터 패킷을 받아야합니다. 어떤 방법으로 보내고받을 수 있습니까? 어떤 프로토콜을 사용해야합니까?안드로이드 모바일에서 GPRS로 데이터 패킷을 수신하려면 어떻게해야합니까?
ServerSocket serverSocket = new ServerSocket(8000); //8000 - port number
Socket client = serverSocket.accept(); // thread will wait here till a client connects
BufferedReader inFromClient = new BufferedReader(
new InputStreamReader(client.getInputStream()));
DataOutputStream outToClient = new DataOutputStream(
client.getOutputStream());
while ((inputLine = inFromClient.readLine()) != null) {
System.out.println("Server: " + inputLine);
if(inputLine.equals("END"))
{
outToClient.writeBytes("END\n");
}
else
{
outToClient.writeBytes("Received\n");
}
}
inFromClient.close();
outToClient.close();
그것의 당신이 처리 할 필요가 TCP 연결 다음 서버가 시작에 스레드를 만들고 할