Pandora not playing nice

zzedly

New member
I realize there is a sultry dance between what Android allows Macrodroid to do and what it's not allowed to do, but I can't decide if that's the case or my own inadequacy.

All I'm trying to do is trigger on the phone connecting to my car stereo, open Pandora, and start playing while the phone remains in my pocket. I have the first two steps down with no problem. But it seems there is no way to reliably start playing Pandora. I've tried:
  1. Control Media-->Simulate Media Button-->Play-->Foreground App
    1. Result = Nothing
    2. Note: Pandora is not in the package list, so "Foreground App" is my only option
  2. Control Media-->Simulate Audio Button-->Play
    1. Result = Plays whatever app that last played.. If that was Pandora, good. If it was the built-in music app, the music app starts playing with Pandora in the foreground.
  3. Control Media-->Default Player-->Play
    1. Result = Always plays the built-in music app, even if Pandora is in the foreground or was last app played.
  4. UI Interaction-->Click-->Identify in App-->Pandora "play" button
    1. Result = Nothing
  5. UI Interaction-->Click-->X,Y Location-->Pandora "play" button
    1. Result = Nothing (won't work when screen is off anyway, per the action info)
Help! Am I missing some method that works better?

Thank you!
 

Abalsam

Active member
I have a free
I realize there is a sultry dance between what Android allows Macrodroid to do and what it's not allowed to do, but I can't decide if that's the case or my own inadequacy.

All I'm trying to do is trigger on the phone connecting to my car stereo, open Pandora, and start playing while the phone remains in my pocket. I have the first two steps down with no problem. But it seems there is no way to reliably start playing Pandora. I've tried:
  1. Control Media-->Simulate MediaButton-->Play-->Foreground App
    1. Result = Nothing
    2. Note: Pandora is not in the package list, so "Foreground App" is my only option
  2. Control Media-->Simulate Audio Button-->Play
    1. Result = Plays whatever app that last played.. If that was Pandora, good. If it was the built-in music app, the music app starts playing with Pandora in the foreground.
  3. Control Media-->Default Player-->Play
    1. Result = Always plays the built-in music app, even if Pandora is in the foreground or was last app played.
  4. UI Interaction-->Click-->Identify in App-->Pandora "play" button
    1. Result = Nothing
  5. UI Interaction-->Click-->X,Y Location-->Pandora "play" button
    1. Result = Nothing (won't work when screen is off anyway, per the action info)
Help! Am I missing some method that works better?

Thank you!
I tried to recreate what you described (I have a free pandora account) but I can't even get pandora to launch (the command is sent but not done) however since my device locks when the screen shuts off, I am not sure if it is a screen off problem or a device locked problem.
 

RSF

Well-known member
This may work -- send an intent from MacroDroid to Pandora to start playing a station.

First you have to get the station ID by using a browser. Log into Pandora, open the desired station, and copy the numeric string at the end of the URL. The URL should look like so:
and you want the "nnnnnnnnnnnn" string.

Then use MacroDroid's "Connectivity > Send Intent" action:
  • Target: Activity
  • Action: android.intent.action.VIEW
  • Package: com.pandora.android
  • Class: com.pandora.android.LauncherActivity
  • Data: pandorav2:/createStation?stationId=nnnnnnnnnnnnn
 

zzedly

New member
Holy crap! I think that worked, @RSF ! See, I knew (in my heart of hearts) that it was going to need the "send intent" action, but I wasn't able to find those magical details for the Pandora app to be able to use it properly. It seems to work properly as I sit here on the couch. I'll let you know how it works in my truck. Thanks again!
 

Abalsam

Active member
This may work -- send an intent from MacroDroid to Pandora to start playing a station.

First you have to get the station ID by using a browser. Log into Pandora, open the desired station, and copy the numeric string at the end of the URL. The URL should look like so:
and you want the "nnnnnnnnnnnn" string.

Then use MacroDroid's "Connectivity > Send Intent" action:
  • Target: Activity
  • Action: android.intent.action.VIEW
  • Package: com.pandora.android
  • Class: com.pandora.android.LauncherActivity
  • Data: pandorav2:/createStation?stationId=nnnnnnnnnnnnn
Is there a reference site where I can find available app intents? It has been hard to find info...

Thanks
 

RSF

Well-known member
Is there a reference site where I can find available app intents? It has been hard to find info...
Agreed - that is a challenge. There's probably a way to inspect an app's APK for its intents and maybe classes and other info, but I'm not familiar with it. Perhaps others can help. Sending well-defined intents to other apps would be far preferable to trying to simulate user interactions...

For this Pandora scheme, I found an APK download site that, for whatever reason, listed the classes supported by the APK. I tried the most likely one or two and found the intent/class that worked. Definitely a case of serendipity and luck, vs. a reliable, repeatable process. So, maybe ... check out various APK download sites (though I'd be leery of actually downloading and installing anything from them)
 
Agreed - that is a challenge. There's probably a way to inspect an app's APK for its intents and maybe classes and other info, but I'm not familiar with it. Perhaps others can help. Sending well-defined intents to other apps would be far preferable to trying to simulate user interactions...

For this Pandora scheme, I found an APK download site that, for whatever reason, listed the classes supported by the APK. I tried the most likely one or two and found the intent/class that worked. Definitely a case of serendipity and luck, vs. a reliable, repeatable process. So, maybe ... check out various APK download sites (though I'd be leery of actually downloading and installing anything from them)
Check out Alex Terns Shortcut Creator at https://play.google.com/store/apps/details?id=com.alextern.shortcuthelper. After installing, select Applications --> Pandora, and it will show you all the public activities. From there, you can test them for the correct one. On the Shortcut window, it will write all the intent code that you will need to copy and paste into your MacroDroid Integrated Development Environment. You may need to modify the channel to suit your tastes, but I hope you get the general idea. This app has a lot of other useful features involving creating your own shortcuts.
 
Top