안녕하세요 안드로이드 시작한지 얼마 안된 초보자입니당
안드로이드 스튜디오로 블루투스 채팅 앱 구현중에 있는데요
터미널이랑 연결해서 통신해보니 제가 스마트폰으로 전송하면 터미널에 잘 입력되는데
터미널에서 제 폰으로 전송될때는 한글자씩 나눠져서 따로따로 출력이되네요 ㅜㅜ
해결방법이 있을까요..?
public void run() {
byte[] buffer = new byte[1024];
int bytes;
// Keep listening to the InputStream while connected (연결된 상태에서 InputStream 수신 대기)
while (true) {
try {
// Read from the InputStream (InputStream에서 읽기)
bytes = mmInStream.read(buffer);
// Send the obtained bytes to the UI Activity (얻은 바이트를 UI Activity로 보낸다.)
mHandler.obtainMessage(BluetoothChat.MESSAGE_READ, bytes, -1,buffer)
.sendToTarget();
} catch (IOException e) {
connectionLost();
break;
}
}
}