Is it possible to control the Rdio Android app from another app?

168 views
Skip to first unread message

Coltin Caverhill

unread,
Aug 16, 2013, 4:32:26 PM8/16/13
to rdio...@googlegroups.com
Can I control the Rdio app from inside another app without Rdio coming to the foreground? Play, stop, pause, ask about currently playing music, etc.


The last post by "Devin S" says he'd talk to the Rdio Mobile Team to see about adding these sort of features, and I'm wondering if that happened?

Currently using an intent like "MediaStore.INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH" is almost ideal for "play", but it launches the app to the foreground. I'd like to use Rdio to do background music (if it's installed).

Thanks,
Coltin

R. Kevin Nelson

unread,
Aug 16, 2013, 4:52:11 PM8/16/13
to rdio...@googlegroups.com
Hi Coltin,

I just spoke with one of our mobile engineers, and we have implemented these features, with one caveat.

Currently, you can control Rdio without it coming into the foreground in all but one circumstance.  Loading a source (i.e. track, album, playlist) currently requires Rdio to be in the foreground, but we are working on letting that happen in the background as well.

You should be able to do things like skip or play/pause with Rdio in the background, and we are also broadcasting intents when the track changes.

I'll update the other thread to link to this post so that the information is easy to find.

Best,
Kevin



-- -- --
R. Kevin Nelson
API Engineer @ Rdio, Inc.


--
You received this message because you are subscribed to the Google Groups "Rdio API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdio-api+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdio-api/fc3405c0-ffb9-4117-8eb4-31bbcc51bc0b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Coltin Caverhill

unread,
Aug 16, 2013, 5:02:05 PM8/16/13
to rdio...@googlegroups.com
Hi Kevin,

Thanks for the quick reply! That's great to hear. Is there any documentation on the current process playing/pausing Rdio in the background?

Additionally when loading songs from tracks/playlists/etc from the background is added, what is the best way to be notified of this feature?

As for the broadcasts I don't require any further information on those. For any Android developers who encounter this post in the future, you can listen to all broadcasts any apps send. Here is an open source project for how: https://github.com/ViliusKraujutis/AndroidBroadcastsMonitor

Cheers,
Coltin

Pascal Laniel

unread,
Aug 19, 2013, 4:22:02 PM8/19/13
to rdio...@googlegroups.com
I've was trying to find how to do something similar. I got it working by faking a hardware key :

void next()
{
sendBroadcast(KeyEvent.KEYCODE_MEDIA_NEXT);
}

private void sendBroadcast(int keycode)
{
KeyEvent keyEvent = new KeyEvent(KeyEvent.ACTION_DOWN, keycode);

Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON).setPackage("com.rdio.android.ui").putExtra(Intent.EXTRA_KEY_EVENT, keyEvent);
sendBroadcast(intent);
}

Hope it helps someone!

Devin Sevilla

unread,
Aug 20, 2013, 12:39:07 PM8/20/13
to rdio...@googlegroups.com
On Fri, Aug 16, 2013 at 2:02 PM, Coltin Caverhill <ultr...@gmail.com> wrote:
> Thanks for the quick reply! That's great to hear. Is there any documentation
> on the current process playing/pausing Rdio in the background?
>

I'll be updating the public documentation, but here are the playback controls:

Broadcast: rdio.android.action.playercontrol
Extra Key: com.rdio.android.playercontrolkey
Extra Value: rdio.android.action.playercontrol.xyz, xyz := { toggle,
play, pause, skipforward, skipbackward }


> Additionally when loading songs from tracks/playlists/etc from the
> background is added, what is the best way to be notified of this feature?

We'll make announcement on the Developer Blog[1] and link to it from here.

[1]: http://blog.rdio.com/developers/

--
Devin Sevilla
API Engineer, Rdio Inc.
http://rdio.com/people/devin_s/

Coltin Caverhill

unread,
Aug 20, 2013, 2:43:35 PM8/20/13
to rdio...@googlegroups.com
I'll give these a spin! Thanks for the responses :)

Anthony Marcinek

unread,
Jan 9, 2014, 9:55:06 AM1/9/14
to rdio...@googlegroups.com
Has anyone been able to get this to work using Llama? I can't seem to get any rdio intents to work. Thanks!
Reply all
Reply to author
Forward
0 new messages