Android SDK Beta
Important: The Android SDK is currently in Beta. The content and functionality may change without warning in future versions.
By using Spotify developer tools, you accept our Developer Terms of Service.
The Android SDK is explicitly prohibited from use for in-car apps, alarm clock apps, ring-tone apps, voice-assistants, broadcast aka “listen together” apps, and to create offline experiences for wearable or other devices.
About the Android SDK
The Spotify Android SDK makes it easy to add Spotify functionality to your Android app. The SDK contains two small footprint binary libraries packaged as Android archives (AAR):
- Spotify Authentication Library. This library provides a way to obtain OAuth access tokens that can subsequently be used to play music or used in calls to the Spotify Web API.
- Spotify Player Library. This library contains classes for audio playback and stream management. It takes care of all negotiation with backend Spotify services, including digital rights management and decoding.
The Android SDK does not have functions for metadata lookup or playlist management. For that, you need to use the Web API, with which you can communicate after receiving an OAuth token from the SDK. You can use a Spotify Web API Android wrapper.
Downloading the SDK
You can download the SDK here
Tutorial and Examples
We provide a beginner’s tutorial to help you set up your build environment and get started with the Android SDK. It leads you through the creation of a simple app that connects to the Spotify service and plays a track.
Within the download packages you will also find some example code to help get you started.
The download packages includes comprehensive documentation of all API classes. Because Android libraries cannot include Javadoc files, HTML documentation is shipped within the download zipfile. You can also read the documentation online.
Please report problems with this SDK through the public issue tracker on GitHub.
Authentication and Authorization
To authenticate an application user, to get the user’s authorization to access private data, and to stream music, your application will first need to connect to the Spotify Android client or Spotify Accounts Service and retrieve a valid OAuth access token. The Android SDK’s Authentication Library provides the classes you need to do this.
You can perform the authentication/authorization either via Spotify Android client or in a browser window. Our Android SDK Authentication Guide provides instructions and examples for both methods.
The authentication of the user and the authorization of scopes follows exactly the same path as user authentication and authorization for the Spotify Web API; for detailed information, see the Authorization Guide.
Terms of Service
Note that by using Spotify developer tools, you accept our Developer Terms of Service.
Applications built with this SDK may be publicly distributed via app stores, however, if the application streams full-length tracks from Spotify you cannot charge users for it (for more about commercial restrictions, see the Developer Terms of Service).
Please also note that streaming of full-length tracks is only available to your users who have a Spotify Premium subscription.