посмотрите на BluetoothChat примере. ConnectedThread.run()
считывает данные с InputStream
.
public void run() {
Log.i(TAG, "BEGIN mConnectedThread");
byte[] buffer = new byte[1024];
int bytes;
// Keep listening to the InputStream while connected
while (true) {
try {
// Read from the InputStream
bytes = mmInStream.read(buffer);
// Send the obtained bytes to the UI Activity
mHandler.obtainMessage(BluetoothChat.MESSAGE_READ, bytes, -1, buffer)
.sendToTarget();
} catch (IOException e) {
Log.e(TAG, "disconnected", e);
connectionLost();
break;
}
}
}
нет друг. Это другая проблема. Я хочу, чтобы данные устройства поступали через bluetooth на консоли ... – chenna
Кто-нибудь там, чтобы помочь? – chenna