toga icon indicating copy to clipboard operation
toga copied to clipboard

Android location service updates are unreliable

Open mhsmith opened this issue 1 year ago • 2 comments

Originally posted by @freakboy3742 in https://github.com/beeware/toga/issues/2462#issuecomment-2024498065

I've only been able to test in the emulator, which has an interface for setting geolocation points; but using that UI doesn't seem to have any impact on the running app:

  • It will return a GPS read in response to retrieving the current location; but if you use the "Single point" GUI to change the current location, the same (original) location is consistently returned
  • The "Routes" UI lets you describe a driving path, but it doesn't seem to generate any location update events.

I'm unsure if this is me driving the emulator wrong, a bug in the emulator, or misuse of the geolocation APIs. If you're able to take this for a walk (literally), and/or let me know what I'm doing wrong with the emulator, that would be helpful.

mhsmith avatar Apr 22 '24 16:04 mhsmith

I'm seeing the same thing on the default Briefcase emulator. But if I use Android Studio to create an "Android 14.0 (Google APIs)" image, which includes Google Maps, I find that Google Maps updates correctly. And when I switch back from Google Maps to Toga's example app, it updates its position, but then it doesn't update again until I switch to Google Maps again.

On my physical device (Pixel 7), I saw the same behavior at first. But then after the first time I opened Google Maps, the example app started working perfectly with no need to switch back and forth, even after restarting my phone.

mhsmith avatar Apr 22 '24 16:04 mhsmith

See also #2495.

mhsmith avatar Apr 22 '24 16:04 mhsmith