My geo location flow stoped working correctly. Strange error

Post your questions and help other users.

Moderator: Martin

Post Reply
lord_EarlGray
Posts: 19
Joined: 16 Jun 2018 21:17

My geo location flow stoped working correctly. Strange error

Post by lord_EarlGray » 25 Jul 2018 15:23

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.

Image
log.txt
(26.05 KiB) Downloaded 674 times
flow_LocationOnStatusbar_20180725_151606.xml
(13.63 KiB) Downloaded 688 times

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: My geo location flow stoped working correctly. Strange e

Post by Desmanto » 26 Jul 2018 06:22

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).
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.

Post Reply