Page 1 of 1

Save current location and go back later using Google Maps

Posted: 03 Mar 2019 02:05
by elektroinside
Save your current location (or of your car/bike) and go back to it later using Google Maps. It uses a shortcut/widget to trigger, then pops up a notification (with buttons, if expanded) in the status bar which will stay there (on Android Pie) until you click on the "close" button (in case something goes wrong with the Google Maps app and you want to retry). Location is network based (not GPS), with speed in mind (or underground parkings). Accuracy might be poor in some cases, or might fail entirely, but the flow tries to get location with 3 accuracy settings (25m, 30m and 50m). With mobile data on, I get a pretty good accuracy, within 5m. These can be adjusted if necessary.
It also copies to the clipboard the entire Google Maps link, if successful, so you can send/share it with somebody, or save it somewhere (eg. mail).
Test everything before use and do not make this your primary "go back" method when hiking (or other critical scenarios)!

Possible failing points:
1. The flow enables mobile data (when needs it - and turns it back off if not needed anymore - but turns it back on and leaves it like this when it opens Google Maps), so you have to give "modify systems settings" rights through adb (or root your phone), otherwise it will fail. Read this on how to give this permission to Automagic on non rooted phones: viewtopic.php?f=3&t=6899. You don't need to enable GPS (as in the post), just give permissions to Automagic. Or, delete the tiles corresponding to this action entirely (named: Set System Setting: Global mobile_data1) and manually enable mobile data.
2. "mobile_data1" in the tiles enabling mobile data is for sim number 2 on my phone. Adjust to 0 in case your phone is single sim (or whatever the number in your phone, eg. mobile_data0).
3. It uses ping to verify internet connectivity and get better location on some phones. Might also fail on some phones.
4. Notifications on non Pie (< v9) Android phones. Adjust accordingly if necessary, as there are no "notification channels" (and other options) on other versions.
5. You have to have Google Maps already installed, and in case it does not open, adjust the package names.
6. Can be adjusted to use GPS as well. When going back to the location, it is recommended to manually enable GPS based location.

Enjoy! :-)

PS. Tested and working on Android v9 (Pocophone F1 with MIUI 10.2)

Link contains 2 flows (enable both) and 1 widget: ... 21c151bf39

Re: Save current location and go back later using Google Map

Posted: 03 Mar 2019 08:21
by elektroinside
Updated, but just cosmetic stuff. Notification channels & groups were changed though, so please reconfigure if necessary (for "notifications on status bar").