0

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.

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 ?

user3201419
  • 31
  • 1
  • 5

1 Answers1

0

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();
}
}
};
user3201419
  • 31
  • 1
  • 5