BLE - Facing Data Loss in Android Library(.aar) for Bluetooth Low Energy for Unity

21 views Asked by At

I have developed an Android library for BLE (Bluetooth Low Energy) communication intended for integration into Unity Android applications. However, I am encountering a notable issue of data loss during communication. It's noteworthy that when the same code is utilized in a standalone Android application, it functions without any data loss. Yet, once compiled into an Android library and integrated into Unity, data loss becomes evident.

Data Rate:: 4269/bytes per second

Further observations reveal:

  1. If I initiate the Unity application using the Android BLE library before utilizing my standalone Android application for BLE communication, data loss occurs on the Android application side as well.
  2. Conversely, if I first run the standalone Android application followed by the Unity application employing my BLE library, there is no observed data loss on the Unity side.
  3. However, subsequent runs of the Unity application result in data loss.

These observations suggest a potential issue with internal Unity processes not adequately prioritizing BLE communication, or it could relate to the Android OS not prioritizing BLE connections from Unity.

What steps should I take to address this issue effectively?

0

There are 0 answers