Hi, I have created flow to show mu current geo location on statusbar. It uses http request. All worked fine up today. Now I'm getting error each few runs on statusbar (picture) I don't know what does it mean and how to fix this flow to work correctly all the time. I think that maybe this error is caused by sme changes in reverse geo location API I'm using.
Flow and log are attached.
My geo location flow stoped working correctly. Strange error
Moderator: Martin
-
- Posts: 19
- Joined: 16 Jun 2018 21:17
Re: My geo location flow stoped working correctly. Strange e
The address url works fine. It seems to be the OSM server didn't respond with proper json as the result, probably server timeout or maybe you have queried too many times in a day. Try to put a debug dialog after the http request and check the content of the response. You need to add extra check, when the response is not a valid JSON type, it will produce error. Add another toast message from the http post and change the connection to exception. Stop the flow at there (or retry after certain period).
To reduce the frequency of the query, you can save the previous location. When the next check triggered, calculate the distance between current location vs previous location. If it is less than (let's say) 50 metres, then no need to query the geolocation.
Be careful, you are leaking your location from your log. Please edit your first post and remove the log (or censor the coordinate).
To reduce the frequency of the query, you can save the previous location. When the next check triggered, calculate the distance between current location vs previous location. If it is less than (let's say) 50 metres, then no need to query the geolocation.
Be careful, you are leaking your location from your log. Please edit your first post and remove the log (or censor the coordinate).
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.