beeware / toga

A Python native, OS native GUI toolkit.
https://toga.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
4.35k stars 670 forks source link

Android location service updates are unreliable #2525

Open mhsmith opened 6 months ago

mhsmith commented 6 months ago

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:

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 commented 6 months ago

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 commented 6 months ago

See also #2495.