1

What I want to do is to get current playing song data. Song might be on spotify or any other music player. Actually I want to get data which transferred to phone hardware.

  • Is it possible ?
  • Is there a provided way to do it ?

I've tried, Broadcast Receiver with these filter but onReceived did not invoked. (tested with spotify android app)

    IntentFilter iF = new IntentFilter();
    iF.addCategory("ComponentInfo");
    iF.addCategory("com.spotify.mobile.android.service.SpotifyIntentService");
    iF.addCategory("com.spotify.mobile.android.service.SpotifyService");
    iF.addAction("com.spotify.mobile.android.ui.widget.SpotifyWidget");
    iF.addAction("ComponentInfo");
    iF.addAction("com.spotify");
    iF.addAction("com.spotify.mobile.android.service.SpotifyIntentService");
    iF.addAction("com.spotify.mobile.android.service.SpotifyService");
    iF.addAction("com.spotify.mobile.android.queuechanged");
    iF.addAction("com.spotify.mobile.android.metadatachanged");
    iF.addAction("com.android.music.metachanged");
    iF.addAction("com.android.music.playstatechanged");
    iF.addAction("com.android.music.playbackcomplete");
    iF.addAction("com.android.music.queuechanged");
    registerReceiver(mReceiver, iF);
Kara
  • 5,996
  • 16
  • 49
  • 56
harunurhan
  • 1,326
  • 1
  • 16
  • 21
  • See also this question: http://stackoverflow.com/questions/26301113/how-to-get-info-of-what-user-listens-currently-in-spotify-app – Nik Reiman Oct 25 '14 at 09:45

1 Answers1

0

As of API 19, you can use RemoteControlClient.OnMetadataUpdateListener.

323go
  • 14,070
  • 6
  • 32
  • 40