Tasker: The app that can really do everything
There is now an app for everything, not just the important things. But there is a single app for almost everything. This is the dream of every Android tinkerer. Its name: Tasker.
A cogwheel with a lightning bolt through the centre. It doesn't look like much, but it has enormous potential. The app is called Tasker and is the alpha and omega of apps among Android users. When Android competitor Apple advertised the release of the iPhone 3G with the slogan "There is an app for that", the developers at Crafty Apps EU took this to heart and created an app that is unrivalled. Tasker can do a lot, which is why the app is worth the effort. Because at the end of this article, we will realise a little life hack that allows Spotify music to play when you plug in your headphones. A lifesaver for the morning commute.
Security-conscious users and those who take the trouble to read the app permissions before installation will probably feel nauseous when reading this. This is because Tasker demands a great deal of openness from users:
- Call up active apps
- Read calendar appointments and confidential information
- Add or change calendar appointments and send emails to guests without the owner's knowledge
- Read contacts
- Change contacts
- Approximate location (network-based)
- Exact location (GPS and network-based)
- Read SMS or MMS
- Receive SMS
- Send SMS
- Edit SMS or MMS
- Call phone numbers directly
- Change phone status
- Reroute outgoing calls
- Read call list
- Get phone status and identity
- Edit call list
- Read USB memory contents
- Change or delete USB memory contents
- Read USB memory contents
- Change or delete USB memory contents
- Record images and videos
- Record audio
- WLAN connection information
- Retrieve WLAN connections
- Device ID & call information
- Get phone status and identity
- Body sensors (such as heart rate monitor)
- Make and disconnect WiMAX connections
- Close other apps
- Call up network connections
- Pairing with Bluetooth devices
- Access Bluetooth settings
- Change network connectivity
- Create and disconnect WLAN connections
- Change WiMAX status
- Disable screen lock
- Hide/show status bar
- Access to all networks
- Close other apps
- Change audio settings
- Read synchronisation settings
- Run on startup
- Set time zone
- Set background
- Show on top of other apps
- Control vibration alarm
- Disable sleep mode
- Change system settings
- Enable or disable synchronisation
- Set alarm clock
- Google Play licence check
These are 52 authorisations that require access to pretty much everything your smartphone has to offer. Unlike a torch app that also wants to read your text messages and emails for marketing reasons, Tasker really needs these permissions because there are very few things that Tasker can't do. According to the bug list, there are exactly 18 things that Tasker can't do.
The big but
Tasker is a stroke of genius in app development, even if it turns the principle of an app on its head. Where an app simplifies a single function, Tasker goes and allows unlimited access with the promise of simplifying everything. Essentially, it's about automation. Of everything.
My previous Tasker projects include, among others:
- An alarm clock with advanced functions such as "get louder on second ring" and "play me this MP3 file". I retired this project after implementing these functions in the Google default alarm clock
- Extremely precise silence times. My mobile went silent between 8am and 11.45am, then again after 12.30pm and 4.45pm, then again after 11pm. Sure, my Android phone had a built-in Do Not Disturb function back then, but it could only silence at night. Since this was also fixed in a newer version of Android, this project was also retired.
- The WiFi function is only switched on between 6 pm and 11 pm
- When I connect headphones to my mobile, Spotify starts and the volume is adjusted to my favourite volume
This all sounds great, but there's a catch. Tasker is anything but intuitive. Not because the developers mean users any harm, but because they have to fit a huge number of features, variables and options into one app.
An example: The headphone Spotify function worked great on my first Android phone. It doesn't work on my current one, an old Samsung Galaxy S5. The reason is still unknown to me at the moment. I suspect that Spotify has released a massive update with far-reaching changes to the app. This probably invalidated the command that is supposed to play the music. Because I had to make it up myself many months ago. It's com.spotify.mobile.android.ui.widget.PLAY and can be translated roughly as follows: In the Spotify app for Android "com.spotify.mobile.android", use the Play command in the built-in widget "ui.widget.PLAY". The widget itself does not have to be placed on a home screen for this.
I guess I have no choice but to repeat the search and restart the whole process. There are at least three possibilities that I can think of in a hurry:
- Update the above-mentioned variant with com.spotify.mobile.android.ui.widget.PLAY
- Simulate a click with the third-party Tasker plugin AutoInput, which is part of the AutoApps Suite
- Send a command to the Spotify app with a so-called Media Control Action in Tasker
The app manufacturers rarely support Tasker and do not provide support for Tasker problems. A community of tinkerers, hackers and coders has therefore formed online, which does not meet anywhere centralised, but has nevertheless set itself the goal of automating everything. Somehow.
Tasker is a great way to get to know Android as an operating system and your smartphone or tablet as a device. Tasker also brings the hacker spirit to life. Rarely will you have so much fun and frustration at the same time thinking outside the box and doing things you shouldn't be able to do.
Lifehack of the day - Spotify plays music
After an evening of tinkering on the sofa and countless attempts, I managed to create a function that lets Spotify play music as soon as I plug in my headphones. A small side note: Just because it works on my old Samsung Galaxy S5 doesn't mean that this solution will work universally.
However, here is a guide that will certainly put you on the right track and probably even become the solution:
Profiles
- Click on the +
- Optional: Give your profile the name Headphones Spotify
- Click on State
- Click on Hardware
- Click on Headset Plugged
- Type Any
- Click on < at the top left. This will save your profile
Tasks
Start Spotify:
- Click on the +
- Optional: Give your task the name "Spotify*
- Click on the +
- Click on App
- Click on Launch App and select Spotify
- Click on < at the top left
Wait for the app:
- Click on +
- Click on Task
- Click on Wait and set the value to 2 seconds. This allows the device to start Spotify before any further commands are sent to the app. This number can be higher or lower for you. You'll have to try it out.
- Click on < at the top left
Play music:
- Click on Media
- Click on Media Control
- CMD: Toggle Pause
- Set a tick in Simulate Media Button
- App: Spotify
- Click on < top left
Adjust the volume:
- Click on +
- Click on Audio
- Click on Media Volume
Set the level to a comfortable volume
Click on < at the top left
Finally, click again on the < at the top left and that's it.
In Tasker's exported syntax it looks like this:
Spotify On (3)
A1: Launch App [ App:Spotify Data: Exclude From Recent Apps:Off Always Start New Copy:Off ]
A2: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A3: Media Control [ Cmd:Toggle Pause Simulate Media Button:On App:Spotify ]
A4: Media Volume [ Level:13 Display:Off Sound:Off ]
I assume that this also works with other audio players. Just adjust the apps in the list accordingly.
In this sense: Happy hacking!
Journalist. Author. Hacker. A storyteller searching for boundaries, secrets and taboos – putting the world to paper. Not because I can but because I can’t not.