Unexpected Disconnect occurring frequently
I have included an onUnexpectedDisconnect with the board on my android application.
Under what circumstances does the function trigger?
I have been testing on multiple phones and some of them see a lot of triggers while others dont. Is there anything I can change in my code to handle the triggering of the function?
Comments
It works exactly as the name says:
https://mbientlab.com/androiddocs/latest/metawearboard.html#unexpected-disconnects
What do you currently do in the handler?
I am getting frequent disconnects on certain devices and no disconnects on others
You need to handle disconnects and automatically re-connect. This is typical of Bluetooth.
A disconnect or a failed connection is very typical in Bluetooth and should always be handled with smart code.
If the disconnect is happening every few seconds or more than twice, it could be a different issue. This would point to a Bluetooth issue on your machine or a problem with the sensor (the most likely suspect is battery).