Create a remotely activated panic mode using Tasker (Android)

Tracking lost phones is big business these days, with companies like Apple and Samsung having their own services to handle it right out of the box. You can also use third party software if your device doesn't have anything like it built in (or you want more features). These won't do you much good if the phone is turned off of course, but there have been plenty of times when these sort of tracking systems have actually helped recover lost or stolen devices. 

You don't absolutely need to have dedicated software for this though. Another way to go about this is with Tasker, the automation app I love talking about. Tasker's beauty is that it's very versatile by default, so you may be able to set it up to do things that the more specific tracking apps can't. Or alternatively, set it up to do much simpler, yet useful, event based alerts.

To start setting up such a "panic mode", you first need a trigger – something that activates it. I use the "Received Text" trigger that you'll find under "Event" and "Phone" when you create a context in Tasker, and use a specific code word in "Content" to trigger it. That means that the phone activates the mode when it receives a text message that contain the code word, regardless of who sent it. You can however limit it by sender as well. Other potential triggers might be location or inverted WiFi connection ("not connected") if your device is e.g. a home device that isn't supposed to go anywhere. There are tons of potential triggers, so just find something that works for you. 

As for what is triggered by this, well, that's where it gets interesting. Your imagination and needs are really what sets the tone here. To give you some idea, here is my task list that is triggered by the incoming SMS:

  1. Raise media volume to max. 
  2. Play sound file 1 (located on the internal memory). This is a voice recording of me saying (in Norwegian): "Hi this is Andreas Ødegård's phone. I'm either lost or stolen. Please contact me on the email address on the screen, or speak a message to me when this message finishes and it will reach me". The email address is visible thanks to WidgetLocker.
  3. Start audio recording. Save file as date – time in a pre-defined internal folder. 
  4. Activate a profile that does nothing but start searching for a GPS fix. 
  5. Wait 30 seconds
  6. End audio recording, save file. 
  7. Pull GPS location. 
  8. Save date, time, location, and battery status to a text file in the same folder as the audio file. 
  9. Deactivate GPS tracking profile
  10. Play sound file 2: Notifies that the location has been read and sent to the device owner. 
  11. Run Dropsync

Dropsync is set up to sync the folder with the audio recording and the text file with time and location with my Dropbox account. It syncs every time a file is added or updated, so the last Tasker action is just in case the battery is below Dropsync's auto cut-off .

In practice, this makes the phone turn up the volume, play a message, record a reply, read GPS location, and send all that to a Dropbox folder. Do note that this is my secondary tracking system, not my primary one, so the fact that this is loud and obvious is intentional. You could just as well find the location silently, or do all sorts of other things. Heck, you could use text-to-voice to make the phone scream "help me" repeatedly if that's what you want. With Tasker running underneath a password lock, it should be able to run in peace until someone pulls the battery. By then, nothing else works either. 

Of course this doesn't need to be for when the device is really lost or stolen either, it can just as well be for when you misplace it. A few tweaks, and your phone is screaming "over here" at full volume when you send it a message…or "I told you to keep it inside" when your kid carries your $500 tablet outside to play in the yard. 

Pocketables does not accept targeted advertising, phony guest posts, paid reviews, etc. Help us keep this way with support on Patreon!
Become a patron at Patreon!

Andreas Ødegård

Andreas Ødegård is more interested in aftermarket (and user created) software and hardware than chasing the latest gadgets. His day job as a teacher keeps him interested in education tech and takes up most of his time.

Avatar of Andreas Ødegård

4 thoughts on “Create a remotely activated panic mode using Tasker (Android)

  • I have built something similar. And I would like to export it as a standalone app using App Factory for my friends. But they would like to be able to change the activation text themselves from time to time. What should I add to achieve that? First thing come to mind is to create a new task that uses Variable Query and assign the value to a variable and use that variable to match with Received Text. But then after the app is installed, it would run in the background automatically, and how do I activate the Variable Query screen (task)???

    • Avatar of Andreas Ødegård

      It will have to be running at all times anyways to know that a text has arrived.

      The way settings are handled in kids is normally to create a scene that has all the necessary options and settings. You then specify a scene launch task for that scene as the launch task for the app. That means that opening the app from the app tray will get you into that scene, while it will continue to run in the background to check for messages. It’s also possible to create a launch task that lets you set it only once, to prevent tampering, password lock the scene, etc

  • Not sure I understand fully. But let me try. What I would need to do is to have a single task that launches a scene to allow changing of the password and when a certain button is clicked on the scene, the scene runs my original profile+task in the background??

    And when I create the APK, I should export the task that calls the scene? (Not my original profile+task)

    • Avatar of Andreas Ødegård

      As long as the profile is part of the export, it will run in the background just from opening the settings scene once. When you make something that includes several profiles, tasks, scenes, however, put it in a project, and export that. In fact, you cannot export a profile directly, only as part of a project.

      I should warn you that exporting anything as an apk means youre getting into the parts of tasker where you need to understand the logic behind how an app works, making it dynamic, accounting for everything, being able to fix bugs, etc. I havent covered app exports in the guide yet because I feel that should really only be done by those who have advanced far enough in tasker proper to make something that’s actually an app. I will probably never cover it, in fact, as I dont think it’s a beginner feature – no matter what the intention of the dev was. The moment your app requires/allows for settings and options, and you suddenly have to deal with device/os specific issues dynamically, it’s a whole other ball game.


Leave a Reply

Your email address will not be published. Required fields are marked *