How to Start, Play, Pause and Kill Pandora with Tasker

ArtieD

Member
Joined
Jan 1, 2011
Messages
35
Reaction score
1
Location
Newport Beach, CA
I love Pandora and use it frequently and with multiple sound devices. But I want it to start and play it automatically when I connect it to my headphones or car and then I want it to stop automatically when I disconnect it. I love Tasker too and thought it would allow me to do those tasks easily. Well, it can do those things, just not very easily. Here’s how I got it done. Sorry it’s not very elegant, but easy just wasn’t in the cards for this chore. I have a DROID X.

First: the issues. The Media Actions in Tasker don’t work for Pandora. So forget about Media Control (Next, Pause, Previous, Toggle Pause and Stop), Music Play and Music Stop. Also, the Kill App Action in the App Actions group doesn’t work (supposedly some Android OS limitation). Soooo what to do?

What does work? Pandora will start to play automatically when it is started from an Off state (not Paused, but Off, as in after Quitting Pandora). So that means we need to always start from a Pandora Off State. So we will always Quit or Kill Pandora whenever we stop listening to it. The Tasker Load App Action does work for Pandora. So when the Task Load App/Pandora is executed with Pandora in the Off State, the command will Load Pandora and Pandora will start Playing.


OK. So how do we get Tasker to put Pandora in the Off state when we are done listening? This is the tricky part. First we need to get Pandora in the Pause State and then we can kill it. For Wired Audio Connections this is not a problem. When the Audio Wire is pulled from the Headphone Jack, Pandora will automatically go into the Pause State. But when Bluetooth connections are terminated, Pandora will keep playing and turn on the Phone Speaker. So here is how we put it in Pause State. Pandora will Pause if another music App starts playing. I use doubleTwist for my music player on the phone and have it set as the Default Music Player (which must be done for this to work), but this should also work for the default Music player. I have Tasker Load the App doubleTwist and then execute Media Control/Toggle Pause. Next Action is Media Control/Pause. Now both Pandora and doubleTwist are in a Pause State.

Now I need to kill Pandora. For this I use the App Fast Reboot Pro by Great Bytes Software. This App does not require root and does not actually reboot your phone. It closes and restarts all core and user processes. But it will not kill an App like Pandora if it is Playing at the time. So that is why we put Pandora in Pause State. The free version of Fast Reboot closes and restarts everything, but does not allow you to selectively exclude Apps. I didn’t like that limitation and also think it adversely affected Tasker’s performance so I ponied up for the Pro version for about $1.40 (€0.99). Fast Reboot Pro is an App and a Widget. Tasker can Load an App, but can’t Load a Widget. So you need to set up the App first and then you can Load it with Tasker. To set it up, you first open the App and select the processes you want to exclude. I excluded almost every (especially exclude Tasker)
except Pandora. We need to set it to the One Button Option so that Tasker can Load it (otherwise it loads up with the options screen and you would need to press some buttons), but once you set it to that option you can’t edit your exclusions without uninstalling and reinstalling the App (and then it loses your setting and you need start all over again, not a good thing). So test it first. When satisfied it works the way you want, Set the One Button Option to Yes. Now Opening or Loading the Fast Reboot Pro App will execute the close/restart processes that the Widget does. So that’s the way we Kill Pandora. First, we Pause Pandora by Playing doubleTwist. Then, we Pause doubleTwist. And finally we Kill them both. We now have everything in the Off State ready for our next listening connection.

Tasker Profiles

I use Pandora five ways:

  1. Bluetooth Stereo Headphones – State/Bluetooth Connected/Bluetooth Stereo Headphones
  2. Wired Stereo Headphones – State/Headphones Plugged In and State/Not Bluetooth Connected/Car Bluetooth (CLS)
  3. Bluetooth Car Audio (Acura MDX) – State/Bluetooth Connected/Car Bluetooth (MDX)
  4. Wired Car Audio to AUX Input (Mercedes CLS550) – State/Headhones Plugged In and State/Bluetooth Connected/Car Bluetooth (CLS)
  5. Play through the phone speaker – Hardly ever use this, but if you do…be sure to Quit (not Pause) Pandora when you’re finished to insure the Tasker will work properly when used
In addition to having Tasker Load Pandora I have it adjust the Phone’s Media Volume because the Bluetooth connections all require Media Volume to be set at maximum because the Bluetooth device controls the volume. But with wired headphones you need the phone to control the volume. So for the wired headphones I have Tasker set the volume to level 5. So here are my tasks to get ‘r done.

Start Tasks

  1. Display/Turn On
  2. Media/Media Volume/Level 15
  3. Apps/Load App/Pandora (for some connections I use Tasker/Perform Task/Music App Menu from the Tasker Wiki)

End Tasks

  1. Media/Media Volume/Level 0 (Not needed for Wired Connections, but for Bluetooth Connections you get a blip of music until the other commands are executed)
  2. Apps/Load App/App doubleTwist (not required for Wired Headphone Connection)
  3. Media/Media Control/Cmd Toggle Pause (not required for Wired Headphone Connection)
  4. Media/Media Control/Cmd Pause (note Stop does not work) (not required for Wired Headphone Connection)
  5. Tasker/Wait/10 Seconds
  6. Apps/Load App/Fast Reboot Pro
  7. Tasker/Wait/5 Seconds
  8. Media/Media Volume/Level 5
This works for all my Pandora sound devices, with some minor adjustments for each device. I hope this helps you and you find this works for you. If anyone knows of an easier way to do this, I’d love to hear about it.

FOLLOW-UP
I've been using this for a few weeks now and it works as presented, but I think that killing Pandora with the Fast Reboot Pro App is messing up Pandora. I seem to be getting an awful lot of songs that I just heard the prior time I used Pandora. I think that Pandora keeps track of what songs in your playlist you've listened to and picks up from the proper place if you just leave Pandora running or quit the App from its own Quit command. So for now I've removed the Load App/Fast Reboot Pro Action. So that means when I connect my device to the phone Pandora will become active and then it may start on its own or I may have to hit the Play button, depending on what state Pandora is in. There must be some way to stop and start Playing on Pandora. The Navigation App and Phone calls start and stop it.
 

amwmedia

New Member
Joined
Jun 28, 2010
Messages
10
Reaction score
0
Location
PA, USA
another solution

I found a nice solution for killing pandora on Android 2.2.

Media\Media Control\Pause
App\Go Home
App\Kill App\Pandora

This does the job for me.
 

knownchild

New Member
Joined
Jul 15, 2011
Messages
2
Reaction score
0
I use the above method in the following post, you can download the profile if you want to take a closer look.

Pandora Alarm Clock

I have a backup profile here that turns pandora off "stops the apps process" when you unplug your headphones and auto starts pandora when you plug your headphones back in.
Keep in mind i set tasker to do this only for a headset without a mic, you can adjust the settings to your liking ;)


Here is a link




you will need to download Secure Settings from the Market (play store)
Let me know what you think, ill re-upload the tasker backup if the link ever dies (just PM me)
 

Ric5150

New Member
Joined
Jun 3, 2016
Messages
1
Reaction score
2
Current Phone Model
S6
Hate to resurrect an old post but it is the first one to come up on Google, and I finally have a way to stop Pandora with Tasker that seems to work. I have an S6. In a task, I set it up like this:

Media -> Media Control > Cmd = Pause, App = Pandora (I don't remember being able to set app before)

Task -> Wait -> Seconds = 2

App -> Kill App -> Pandora


I don't guess this completely removes it from memory until the OS kicks it, but it stops Pandora and removes the notification icon which is good enough for me. I hope this helps some people out, I've been messing with it all day.
 

FoxKat

Premium Member
Premium Member
Joined
Apr 2, 2010
Messages
14,651
Reaction score
4,703
Location
Pennsylvania
Current Phone Model
Droid Turbo 2 & Galaxy S7
Hate to resurrect an old post but it is the first one to come up on Google, and I finally have a way to stop Pandora with Tasker that seems to work. I have an S6. In a task, I set it up like this:

Media -> Media Control > Cmd = Pause, App = Pandora (I don't remember being able to set app before)

Task -> Wait -> Seconds = 2

App -> Kill App -> Pandora


I don't guess this completely removes it from memory until the OS kicks it, but it stops Pandora and removes the notification icon which is good enough for me. I hope this helps some people out, I've been messing with it all day.
Great detective work and thanks sir, for sharing. It's input like yours that makes this forum what it is.

Sent from my XT1585 using Tapatalk
 
Last edited:

Kryhavok

New Member
Joined
Aug 2, 2016
Messages
1
Reaction score
0
Current Phone Model
Nexus 6P
Hate to resurrect an old post but it is the first one to come up on Google, and I finally have a way to stop Pandora with Tasker that seems to work. I have an S6. In a task, I set it up like this:

Media -> Media Control > Cmd = Pause, App = Pandora (I don't remember being able to set app before)

Task -> Wait -> Seconds = 2

App -> Kill App -> Pandora


I don't guess this completely removes it from memory until the OS kicks it, but it stops Pandora and removes the notification icon which is good enough for me. I hope this helps some people out, I've been messing with it all day.

Just made an account here to reply to this with a huge THANKS! I recently got a Huawei Watch and while I like having the pandora notifications/controls from my watch, having them up all the time until I go in and manually kill pandora on my phone was driving me nuts. I had tried just a Kill App task but it wasn't always working. Your method seems to work great, even if my phone is locked.
 
Top