Search code examples
androidintegrationspotifylibspotifyspotify-app

Spotify Android integration, Is it possible to preview track without Premium account?


In spotify web-api it is possible to preview track for 30 sec. So, I want to know, is it possible to implement this functionality using spotify android sdk. I was unable to find any Classes or methods related to that and also want to know if this functionality is available in spotify android sdk, then can we test it without spotify Premium account?

OR

Is it possible to use Spotify Web Api in android app?

Any help would be appreciated. Thanks in advance.


Solution

  • The Spotify native SDKs only use a "native" component for playback of full-length songs. The correct, officially-supported way of looking up metadata etc is to use the Web API. The iOS SDK provides a wrapper for this, but the Android SDK doesn't (yet).

    Therefore, yes, you should use the Web API in your Android app. Since the Web API allows 30-second previews without authentication, you can do that in your app too.

    Since the Android SDK doesn't include wrappers for the Web API at the moment, you'll need to build them yourself. The Spotify Web API is just a standard JSON/REST API - there's nothing special about it - so any Android JSON/REST library should be able to interact with it just fine.