A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.spotify.com/documentation/android below:

Spotify Android SDK | Spotify for Developers

Spotify Android SDK

Beta

Allow your application to interact with the Spotify app running in the background as a service.

The Spotify Android SDK supports getting metadata for the currently playing track and context, issuing basic playback commands as well as initiating playback of tracks.

Getting started

The SDK consists of two libraries:

We provide a Getting Started tutorial to help you set up your build environment and get started with the Spotify Android SDK.

The tutorial leads you through the creation of a simple app that connects to the Spotify app, plays a playlist and subscribes to PlayerState. Within the download package you will also find a demo app with full source code to help get you started.

In order to use the SDK, your application will need to get the user's permission to control playback remotely first. The authorization guide explains the two methods available to implement authorization in your Android application.

Key features

Download

The latest stable version of the Android SDK can be downloaded from GitHub.

Requirements

Documentation

The documentation is organized as follows:

API documentation

The download packages includes comprehensive documentation of all API classes in the /docs folder. You can also read the documentation online for the authentication library and for the app remote library.

Frequently asked questions

SpotifyAppRemote connect/disconnect v0.4.0 vs v0.5.0


_10

// If your code looks like this for v0.4.0:

_10

SpotifyAppRemote.CONNECTOR.disconnect(mSpotifyAppRemote);

_10

SpotifyAppRemote.CONNECTOR.connect(this, mConnectionParams, mConnectionListener);

_10

// you should change it to this as of v0.5.0:

_10

SpotifyAppRemote.disconnect(mSpotifyAppRemote);

_10

SpotifyAppRemote.connect(this, mConnectionParams, mConnectionListener);


I want the Spotify app to notify my app when Spotify is active. Is it possible?

You can register a broadcast receiver for an action "com.spotify.music.active". The broadcast is sent when a new track gets on top of the playing queue.

To listen to the broadcast add the next lines to your AndroidManifest.xml file:


_10

<receiver android:name="<ReceiverClassName>">

_10

<action android:name="com.spotify.music.active"/>


To get more information on BroadcastReceivers, have a look at the docs on the Android developer portal.

Can I use Jackson instead of Gson?

Since version 0.2.0 of the SDK, Gson is used by default for serializing  and deserializing the request, but the use of Jackson is still supported. If you want to use Jackson, you need to configure it when connecting to Spotify:


_10

ConnectionParams connectionParams =

_10

new ConnectionParams.Builder(CLIENT_ID)

_10

.setRedirectUri(REDIRECT_URI)

_10

.setJsonMapper(JacksonMapper.create())

_10

SpotifyAppRemote.connect(this, connectionParams, connectionListener);


Support

Please report problems with this SDK through the public issue tracker on GitHub.

Legal

Note that by using Spotify Android SDK, you accept our Developer Terms of Service.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4