spotify-android | A Spotify clone for Android
kandi X-RAY | spotify-android Summary
kandi X-RAY | spotify-android Summary
A Spotify Android APP.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Load a playlist
- Fast - bit blur
- Blur a single image
- Stores an image in the storage
- Set up the drawer view
- Select a navigation drawer item
- Sets the fragment
- Returns a new instance ofShowResultsFragment
- Called when the view is scrolled
- Gets the maximum size of the last visible item in the array
- Start activity
- Load profile image
- Creates and returns the view which is used to show the newly created fragments
- Region Override Override
- This method is called when the menu is created
- Calculates the offsets of a RecyclerView
- Modifies the layout of the view
- Called when a menu item is selected
- On create view
- Click a playlist
- Display error messages
- Invoked when the fragment is created
- Returns the view which is created when the fragment is created
- Create new view
- Create alert dialog
- Create view
spotify-android Key Features
spotify-android Examples and Code Snippets
Community Discussions
Trending Discussions on spotify-android
QUESTION
I am trying to playback songs with a duration less than 10 40 (extremely hard to tell) seconds using the Spotify Android SDK. I am using a button to start playback. When doing so there is no sound most of the time. Spamming the button causes to play sound occasionally (happens hardly ever). PlayerEvent
's kSpPlaybackNotifyTrackChanged
& kSpPlaybackEventAudioFlush
are missing if there is no sound.
I am using Spotify's Android SDK (Docs). I am trying to play songs using playUri(...)
. Certain songs won't render any sound at all after calling playUri(...)
even tho the Player.OperationCallback
's onSuccess
is reached. In another more complex testing environment, I found out that the Player.AudioDeliveredCallback
is not even getting called when this behavior appears. The one thing the non-working tracks have in common is that they are short (duration of fewer than 10 40 (extremely hard to tell) seconds).
I am using the Android SDK version spotify-player-24-noconnect-2.20b
and debug on devices running Android OS version 4.4.2
& 7.0
.
I also listed this as an issue in the Spotify Android SDK which can be found here.
Steps to ReproduceI am using this as a starting point. I removed all of the authentication related code due to I am simply grabbing the OAuth token by myself using the Web API. As well I ignored the Android package name & SHA1 fingerprint pair that should be provided within the Spotify app due to it seems that this is not even getting checked by the service. The player is getting initialized properly which I can tell because there are songs that play without any problems. Therefore ConnectionStateCallback
's onLoggedIn()
is getting called after a short period of time. A debug log message confirms the success of the login procedure. After logged in successfully playUri(...)
is ready to be used by calling it with a Spotify URI. The following implementations of View.OnClickListener
's onClick(...)
methods are used for five different Button
's that utilize playUri(...)
with a working (Button 5) and some non-working (Button 1-4) Spotify URIs.
ANSWER
Answered 2018-Feb-26 at 16:57I actually found a fix for the problem. playUri(...)
's last parameter is an integer which is called "positionInMs" in the docs. When setting it to 1
instead of 0
I don't have any problems at all no matter of the duration of the song to be played.
Technically this seems like the song is getting cut by 1 ms which makes it a pretty dirty fix I think. But practically it isn't noticeable at all and that's why I am cool with it.
QUESTION
On Successful Authorization, I am able to play hard coded track, but their is neither any player nor any pause, stop, play buttons there.
I followed this tutorial, and did everything mentioned there.
Now i need to add spotify Player, but i am unable to find out any documentation related to this. I think i need to create the player layout myself, as player sdk provides different buttons callback, but there is nothing like using a predefined layout for player.
This is what i do after successful authorization.
...ANSWER
Answered 2017-Dec-20 at 18:32If you followed that tutorial, which you say you have and it seems to be working if you're able to play a track, then you have a SpotifyPlayer
reference. That getPlayer
method gives you that.
The SpotifyPlayer
isn't a UI component though. Once you have that player (https://spotify.github.io/android-sdk/player/) you would create your own UI, and wire up your buttons and such to the player actions (methods) and events.
Here is an example that might help (not complete or perfect!, not comprehensive, but a quick example from one sample project that might help to get started):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install spotify-android
You can use spotify-android like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the spotify-android component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page