If you are using Google Now, you are aware of the ‘where I parked my car’ card. The additional card is displayed (needs to be enabled in settings) whenever Google thinks you have stopped driving, and abandoned the vehicle. I don’t drive on a regular basis, I cycle everywhere and I find it very flattering each time Google serves me this card. It proves that Google doesn’t know everything about us just yet, but if you quick enough – the card can be used to find your bike again. Sadly not when it’s stolen.
With the incoming trip to China, I realized that Google services won’t be helping me in my daily life. China blocks their servers. If you are lucky enough to go traveling where Google can’t go, or if you simply prefer other than stock launcher, you might be interested in the replicating the profile below. The project has been suggested to me by Mishaal Rahman from xda-developers.com so thanks to him for that.
Dude, where’s my car?
The profile is fairly simple. I’m going to use AutoVoice or a widget button to save the location. A widget will provide us with a feedback. You will be able to navigate back to saved location via notification or a voice command.
It’s good to point out, that the Android does a pretty decent job at managing your location, but if you prefer to keep your services disabled – you have to enable the location services before getting the value of the %LOC variable. The more location services you have enabled the quicker the fix. By default, Android will check the GPS, mobile data, and WIFI. If you already toggle these – you know what to do, if you are happy with the way the Android works – just leave it on. Otherwise, use AutoTools or the run shell action:
Secure Settings also can also be used to toggle these (here is how to make the Secure Settings enabled). For the sake of this tutorial, I will show you how to use both, a widget and voice command trigger.
Save location with Tasker
Getting location (A1-A4)
There are few things I want to do before getting the location set. Because most of the time %LOC will have a value assigned already (last fix) I only want to use the location coordinates requested through the profile. I will use the global variable %LastLocation to store these coordinates. If the task has been run again due to error or a timeout, I need to clear existing warning notification with the Notify Cancel.
Notifications (A5,A7)
There are two outcomes of the Get Location action. We will end up with a new set of coordinates, or the action will fail to acquire the coordinates. If the fix is found, a notification will be displayed. Note the name of it. We will use this name to trigger the Return Location profile later. If the fix is not found, we want to display a warning with an option to rerun the same task again (Action Perform Task assigned as a button).
Button (A6,A8)
I mentioned earlier that there will be a button; which will change the color to show us a state of our parking profile. Color codes are:
white (ready)
red (fail)
green (armed)
All you need is a widget (not the shortcut) placed on your home screen for the task which will save the location. Make sure to assign an icon to this task to be able to add a task shortcut from the widget screen. I’m using this instead of the shortcut as I get the Tasker to change the color of the icon according to the current state.
One of my favorite ways of getting the icons is the Material Design Icons collection, as you can find the one that suits you and quickly provide the color alternatives.
I have labeled the actions to show which one correspond with fail/success outcomes. The IF conditions %LastLoctation = set/not-set determines that outcome.
Return the location
The task is very simple. We will run a Google Maps intent which will contain a location link:
Our location global variable will supply the needed coordinates. Once this is done, we just need to clean up the variable (please add a wait action) and change the color of the widget icon to white.
Profile: Return To Location
To trigger this task from the notification create an event Notification Click and add the name of the notification created earlier (Location Saved)
You have a complete profile ready.
Linking the AutoVoice
Conclusion
It is easy to assume, that everyone has an access to the same as me resources, but this is not often the case. This project can be modified and used for other purposes, and unlike Google Now parking card, it’s not dependent on google services. You can also experiment with AutoNotification to make the notifications prettier or more interactive. I kept the entire project close to Tasker vanilla experience (apart from AV).
You could also create an array what would store more notification at once, or do something interesting with a collection of these points on the map. Let me know if the project inspires you – I’m always happy to look at the reader’s projects.
You will need:
Android version: 4.0+ (Used 7.0),
Apps: Material Design Icons (optional)
Plugin: AutoVoice (optional), AutoTools (optional)) or Secure Settings (optional)
Needs: root (optional for toggling the location)
You can find the project file to download here.
Save location with Tasker, retrieve it later by Mat Zolnierczyk first appeared on Pocketables.