1

In my app I currently have virtual joysticks using the library suggested in this (Virtual Joystick in Android SDK) post being used to steer something like an RC car.

They work exactly as intended most of the time (say 95%), but occasionally I'll run into issues where the joysticks will snap back to the center despite the user not letting go of the screen. If it happened occasionally it wouldn't be the end of the world but when it first appears it then begins to happen constantly, making them all but unusable.

Also, it seems like this problem only occurs when both joysticks are being used at the same time

I should note that the joysticks snapping back to the center is intended behavior when the user lets go of the stick, but that does not seem to be what's happening.

The app is not very complicated overall, there is a BLE interface to communicate with a control board and a single Activity to host a few Fragments. The BLE interface is fairly active, with communications of 384 data bytes + BLE overhead every ~120 mS, that data rate hasn't been a problem in any other Fragment but I also think this is the only Fragment where a problem would be noticeable.

So far I've tried:

  • Enabling "show taps" and "pointer location" in developer settings to ensure that the user isn't accidentally removing their fingers from the display (they're not)
  • Enabling GPU watch (see screenshot) to ensure that GPU/CPU load isn't significantly higher when the issue occurs (they're not)
  • Reducing updates of LiveData objects in the Fragment's ViewModel to lower processing time
  • Reducing Bluetooth data rate to 240 mS per transfer instead of 120 mS
  • Verify that the Fragment isn't being reloaded/reinitialized by putting Toast pop ups in all initialization, onCreate(), onResume(), etc.. routines

Frankly I'm at a loss here as I feel like I've examined every possible cause of this, any help would be greatly appreciated

Device/software version details:

  • Device is a Samsung Galaxy Tab A, running Samsung's latest Android version (SDK version 29)
  • App is running on Samsung Knox Configure platform
  • Running version 1.10.1 of virtual joystick library (the latest as far as I can tell)

See below screenshot for reference of what the fragment looks like.

screenshot of fragment

nreath
  • 21
  • 5

0 Answers0