I have developed an android music player app. That Play music from local storage
I would like to add online streaming options like Spotify,Gana. Etc….
Im not a professional android developer I’ve developed the app based on other music player source code
So anyone can help me how to add Spotify api or other options…
2
Answers
Using the following code might help you. But I recommend you use google ExoPlayer as it has more features than MediaPlayer from android.
Check that for Google ExoPlayer
ExoPlayer Documentation
Do you mean to play Spotify music in your app? This is usually not possible, because music requires authorization, but if you have an audio file, you can put it in the cloud and use the following code to play it.
Alternative plan
The Spotify SDK allows your application to interact with the Spotify app running in the background as a service. The capabilities of this API include getting metadata for the currently playing track and context, issuing basic playback commands and initiating playback of tracks.
Please refer to: https://developer.spotify.com/documentation/android/