简体   繁体   English

Android:如果手机未通过调试模式连接到PC,则蓝牙速度非常慢

[英]Android: bluetooth is very slow if a phone is not connected to PC with debug mode

I have program for arduino. 我有arduino的程序。 It can transmit image over bluetooth. 它可以通过蓝牙传输图像。

  1. If I make connection from PC: 3 frames in a second. 如果我从PC建立连接:一秒钟3帧。
  2. If I make connection from Android App with USB debug: again 3 frames in a second. 如果我通过USB调试从Android App建立连接:每秒再显示3帧。
  3. If I make connection from Android App without USB debug: 1 frame in 10 seconds. 如果我在没有USB调试的情况下通过Android App建立连接:10秒内1帧。

Does anybody have idea why Android becomes so slow? 有人知道为什么Android会变得如此缓慢吗?

I was able to solve my issue using two solutions: 我可以使用两种解决方案来解决我的问题:

  1. Read data from input stream by one: inStream.read() 从输入流中读取数据:inStream.read()

  2. Send any symbol to output stream every 1 second. 每1秒发送任何符号以输出流。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM