Android的固件4.4.2蓝牙保持断开 [英] Android Firmware 4.4.2 Bluetooth keep disconnecting

查看:585
本文介绍了Android的固件4.4.2蓝牙保持断开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android的蓝牙连接有问题。我有连接到手机的蓝牙设备。该设备将数据发送到电话每10秒

I have a problem in Android Bluetooth connection. I have a bluetooth device connected to the phone. The device will send data to the phone every 10 seconds.

的Andr​​oid固件版本4.4.2以下在发送数据和蓝牙连接没有问题。
的Andr​​oid固件版本4.4.2以上保持每10秒钟或更多断开。这是Android的问题还是我的编程问题?

Android Firmware version below 4.4.2 has no problem in sending data and bluetooth connection. Android Firmware version above 4.4.2 keep disconnecting every 10 seconds or more. Is this the Android problem or my programming problem ?

推荐答案

下面我的编程code。当我在Android手机固件版本4.4.2及以上的测试,它不断收到ACTION_ACL_CONNECTED。 4.4.2以下的Andr​​oid手机固件版本工作完全正常。

Below my programming code. When i tested on Android phone firmware version 4.4.2 and above it keep receiving ACTION_ACL_CONNECTED. Android phone firmware version below 4.4.2 working perfectly fine.

private final BroadcastReceiver mReceiver = new BroadcastReceiver() 
{
@Override
public void onReceive(Context context, Intent intent) 
{
String action = intent.getAction();

if (BluetoothDevice.ACTION_ACL_CONNECTED.equals(action)) 
{
Log.d("MainActivity","Bluetooth connected.");
}
else if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)) 
{
Log.d("MainActivity","Bluetooth disconnected.");    
}else{
Toast.makeText(context, action, Toast.LENGTH_LONG).show();
}
}
};

这篇关于Android的固件4.4.2蓝牙保持断开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆