I'm working on a personal-use Garmin app. It communicates with an API I wrote that runs locally, and ships off various information every 5 minutes. When not connected, the idea is to add the 5-minute data to an array in Storage, and once connected again, to append this offline data to the web request, then overwrite local storage with an empty array.
The problem is that I can't seem to test whether I'm connected or not. I can use `System.getDeviceSettings().phoneConnected` to determine if I've got an active BLE connection to my phone, but for whatever reason, checking if `System.getDeviceSetttings().connectionInfo[:wifi].state == System.CONNECTION_STATE_CONNECTED` always returns `false`, even if I'm connected to WiFi on my phone.
I'm testing this out on a Venu 2 Sq. Music, if that matters.
The only reason I'm checking the connection is to know whether or not to clear Storage. I'd previously attempted to do this on a successful response from my `makeWebRequest` call, but since the action is occurring in a background process, my web request callback is never invoked.
I'm probably not the first person to run into this issue, but I can't find anyone who's solved it in the forums, or else my search queries are no good.
How do you guys handle this situation?