0

My java code runs on Quest 2 (Android 12.0) and subscribes to the gatt cadence characteristic of a cadence sensor. The code runs pretty well apart from two issues.

  1. The Bluetooth stack randomly disconnects from the cadence sensor. Sometimes it disconnects within the first minute, and sometimes it can take up to an hour before it disconnects. Any assistance would be appreciated.

  2. The Cadence notifications typically come in once per second. However some notifications can take up to 4 seconds to come in. In that case all 4 notifications come in at once. Is this typical on Android devices? I don't recall having this problem with IOS.

Boodums
  • 1
  • 3
  • where are you keeping reference to the Bluetooth Device and Bluetooth Gatt objects? Make sure they don't get destroyed - if they do bluetooth will disconnect. – sleepystar96 Sep 01 '23 at 22:36
  • Thanks for the quick reply. The Bluetooth Gatt is stored as a static member variable. The Bluetooth Device wasn't. When I store the Bluetooth Device as a static member variable the problems remain. – Boodums Sep 02 '23 at 18:00
  • I.. personally wouldn't store them as static member variables because they could be mutated by any instance. I'd instead store them as a member variable and make the app use a singleton of my bluetoothprovider service. Also, do you think the OS is killing your app? – sleepystar96 Sep 02 '23 at 18:25

0 Answers0