Sunday, March 13, 2011

Show Menu of Music Apps when Headset Inserted

Here is how to have Tasker detect your headphones and launch a menu of Apps to choose from instead of just the default music App.


  • Click "New" name it "Headset" and click "State" 
  • Select the category "Headset Plugged" and leave the type set to "Any"
  • Click "New Task" name it "App Menu"
  • Click the "Add" button in the bottom left and select "App" and "Load App" Choose a program such as "Music Player" then click "Done"
  • Click on the "Settings" (Spanner) Icon and change the "Task Type" to "Menu" click "Done"
  • Click "Add" again and go to "App" and choose "Load App" again and choose your next App such as "FM Radio" then click "Done" again
  • Repeat this for as many apps as you want to be displayed.
  • Click "Done"
Now whenever you plug in your headset you will be presented with a list of applications to launch. I have Music Player, Google Listen (for Podcasts) and FM Radio set up on mine.

Screen Time-out Settings While Charging with Voice Prompt

Here's how to make a profile use the "Say" task to read aloud chosen text for the active Profile.

Using the previous "Screen Time-out While Charging" Example we will add in the extra steps of the "Say" command.


  • After completing the above example, tap on the "Screen On" Task and choose "Edit"
  • Click the "Add" button
  • Choose "Misc" and then "Say" 
  • In the "Text" box enter what you want to phone to speak. For this example type in "Now Charging"
  • Next to "Engine:Voice" click the magnifying glass and choose "Picco TTS" next choose your language
  • Click "Done"
you should now have a screen showing the "Display Timeout" Task and a "Say" Task like this, Click Done.


Now we need to do the same for the "Exit Task" so click on the "Screen Off" Task and choose "Edit" again.

Select "Add" and choose "Misc" and "Say" just like we did before. This time we want the text to notify us that the cable is unplugged and charging has stopped, so in the text box enter "Charging Stopped" and again scroll down to the "Engine:Voice" box and choose "Picco TTS" and your language. Click on "Done" and then "Done" again.

Now when you plug in the cable the Phone will keep the Display on and say "Now Charging" When you unplug the cable the screen timeout will return to normal and the phone will announce "Charging Stopped"


Screen Time-out Settings While Charging

This Tasker example will show you how to keep your screen on for longer while the phone is charging and return to default when the charger is removed.


  • Open Tasker and click "New" and name the profile "Charging"
  • Choose "State" and select "Power" for this example we'll make it work on both USB charging and AC power so  in the dropdown box select "Any"
  • Select "New Task" and name it "Screen on" Click the "Add" button in the bottom left - choose "Display" and then "Display Timeout" go ahead and choose how long you want the screen to remain on for. I have mine set to 5 minutes. Click "Done" and then click "Done" again
Next we have to make an Exit Task, this is what tells the phone what to do when the charging cable is unplugged. You should have your two tasks showing - "Power" and "Screen On". Click on the Green arrow next to the "Screen on" task. You should now have the option to "Add Exit Task"

  • Click "Add Exit Task" and choose "New Task" name it "Screen Off"
  • Click the Add button in the bottom left and choose "Display" and "Display Timeout"
  • Choose how long you want your screen to remain on when not charging - I have mine set to 30 seconds.
  • Click "Done"
  • Click "Done" again.

Now you should be able to plug in your USB cable and the phone will keep the screen on for the specified 5 minutes before locking the device.

Auto Wake on LAN when returning home

This Profile will show you how to automatically start up your PC using a Wake On Lan program from your Android phone when you arrive home. This example uses the Wifi to detect whether you are at the specified location.

Apps you will need : Tasker
                               Wol Wake On Lan WAN

I am assuming that people will know how to access their IP address and MAC address info to enter into the WOL App. If there's enough demand I will write up how to access that information too but for now let's go ahead and set up WOL in the App and name a profile for it.

Once you have that set up, load up Tasker and click the "New" button located at the bottom of the screen. Name this profile something like "Home" or "Work" or where the profile will become active.

A new window will now open showing you a list of options. Go ahead and choose "State" and click on "Wifi Connected" at the bottom. Another new windows will open click on the magnifying glass next to the SSID and select your wifi network. Scroll the window to the bottom and click the "Done" button.

Tasker will now ask you to select a Task which will happen when your phone connects to that Wifi network. Click the New Task button and name it Wifi, next click the Plus button on the left hand side and choose the "Misc" option and then "Action Intent"

This is where we tell Tasker to talk to the WOL App we installed earlier.

First select the "Action" box and enter "com.benfinnigan.wol.widgetlaunch"
Next choose "Launcher" from the "Cat" dropdown box
Leave the "Data" field blank
In the first "Extra" field enter "CPATH: /mnt/sdcard/wolanwan/profile.dat" Notice the space between CPATH: and /mnt. Replace the word Profile with the name of your settings that you entered into the WOL App earlier.
Next Scroll down to the "Target" dropdown menu and choose "Activity" as the selection.
Click the "Done" button.

You should now have an "Action Intent" listed in the window showing, click "Done" again.

That's it!
Now whenever you arrive at the location with your selected Wifi, your phone will auto wake up the PC.