Android Bluetooth: Slow data rates calculated from BluetoothSocket
问题 Using: HTC Legend and HTC Salsa I'm calculating the speed using: while(true) { try { int num = in.read(buffer); if(reading == false) { prevTime = SystemClock.uptimeMillis(); reading = true; } else { //Calculate KB/s count += num; Long deltaTime = SystemClock.uptimeMillis()- prevTime; if(deltaTime >= 1000) { Float speed = (float)count/deltaTime; Log.d(TAG,"Data: " + speed + "KB/s"); count = 0; prevTime = SystemClock.uptimeMillis(); } } } catch (IOException e) { } } And writing some test data