Abstract Spotify Broadcast Receiver
If you are developing an Android application and want to know what is happening in the Spotify app, you can subscribe to broadcast notifications from it. The Spotify app can posts sticky media broadcast notifications that can be read by any app on the same Android device. The media notifications contain information about what is currently being played in the Spotify App, as well as the playback position and the playback status of the app.
Note that media notifications need to be enabled manually in the Spotify app
You need to extend this class and register it, whether through the manifest or fragment/activity to receive notifications, as well as overriding onPlaybackStateChanged, onQueueChanged, and/or onMetadataChanged.
Functions
A metadata change intent is sent when a new track starts playing.
A playback state change is sent whenever the user presses play/pause, or when seeking the track position.
A queue change is sent whenever the play queue is changed.