[英]print contents of InputStream to LogCat
我在這里有此功能:
public void read() {
byte buffer[] = new byte[1024];
int bytes;
try {
bytes = iStream.read(buffer);
//Send what got read to LogCat here
} catch(IOException e) {
//TODO: something
}
}
它從BluetoothSocket InputStream讀取。 如何顯示讀取到LogCat的內容?
對於此類程序,可以通過使用Log.i(TAG,String.valueOf(bytes));
使用LogCat Log.i(TAG,String.valueOf(bytes));
由Rundyka Yudhistira
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.