Giter Club home page Giter Club logo

android-sdk's Introduction

WARNING: This is a beta release of the Spotify Android SDK.

Spotify Android SDK

Welcome to Spotify Android SDK. This project is for people who wish to develop Android applications containing Spotify-related functionality, such as audio streaming and user authentication and authorization.

Note that by using this SDK, you accept our Developer Terms of Use.

Beta Release Information

We're releasing this SDK early to gain feedback from the developer community about the future of our Android SDKs. Please file feedback about missing issues or bugs over at our issue tracker, making sure you search for existing issues and adding your voice to those rather than duplicating.

Open bug tickets | Open feature requests | All

For known issues and release notes, see the CHANGELOG.md file.

Getting Started

  1. Checkout Spotify Android SDK master branch.
  2. Have a look at the example

The SDK's structure

The Spotify Android SDK consists of two libraries. One of them handles authentication flow and the other one manages audio playback. The libraries work well together but can also be used separately, for example if the application doesn't need to play music it can use just Spotify Authentication module by itself.

Spotify Authentication Library

This library is responsible for authenticating the user and fetching the access token that can subsequently be used to play music or be used in requests to the Spotify Web API.

To add this library to your project add the reference to its build.gradle file:

compile 'com.spotify.android:auth:1.0.0-alpha'

To learn more about working with authentication see the Authentication Guide and the API reference on the developer site.

Spotify Player Library

This library can play music from Spotify after the user logs in with the access token. Only Premium Spotify users will be able to log in and play music with this library..

To add this library to your project copy the spotify-player-*.aar file from the Android SDK to the libs folder in your app project and add the reference to its build.gradle file. For version 24-noconnect-2.20b it would be:

compile 'com.spotify.sdk:spotify-player-24-noconnect-2.20b@aar'

To learn more about working with the player see the Beginner's Tutorial and the API reference on the developer site.

Spotify Web API

The Web API wrapper is currently not a part of the SDK project but there are a few open source Web API libraries available for Android.

Authenticating and Scopes

You can generate your application's Client ID, Client Secret and define your callback URIs at the My Applications section of the Spotify Developer Website.

When connecting a user to your app, you must provide the scopes your application needs to operate. A scope is a permission to access a certain part of a user's account, and if you don't ask for the scopes you need you will receive "permission denied" errors when trying to perform various tasks.

You do not need a scope to access non-user specific information, such as to perform searches, look up metadata, etc. A full list of scopes can be found on Scopes section of the Spotify Developer Website.

If your application's scope needs to change after a user is connected to your app, you will need to throw out your stored credentials and re-authenticate the user with the new scopes.

Important: Only ask for the scopes your application needs. Requesting playlist access when your app doesn't use playlists, for example, is bad form.

android-sdk's People

Contributors

kundzi avatar kaaes avatar erdtman avatar nikreiman avatar thelinmichael avatar jmperez avatar mbruggmann avatar chrishughesspotify avatar

Watchers

James Cloos avatar charles west avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.