Giter VIP home page Giter VIP logo

android-sdk's People

Contributors

arkenson avatar cedrich3 avatar dmarin avatar manneohlund avatar mdelolmo avatar mun0n avatar neonal avatar perploug avatar pimpimmi avatar vacxe avatar veronikapetruskova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-sdk's Issues

AuthenticationResponse returns an error (INVALID_APP_ID)

Issue found on 01/10/2018

OS Version: Android Nougat (Android 7.1.1)

Device Model: Coolpad

Scope(s): streaming, user-library-read, and playlist-read

Steps to reproduce:
Calling the following method

    private void signInSpotify() {
        final AuthenticationRequest request = new AuthenticationRequest.Builder(Constants.SPOTIFY_CLIENT_ID, AuthenticationResponse.Type.TOKEN, Constants.SPOTIFY_REDIRECT_URI)
                .setScopes(new String[]{"streaming", "user-library-read","playlist-read"})
                .build();
        AuthenticationClient.openLoginActivity(parentActivity, 3, request);
    }

I've tested 2 different client IDs in the above code and redirect URI with the following format:

my-example-app://callback/

            AuthenticationResponse response = AuthenticationClient.getResponse(resultCode, data);
            switch (response.getType()) {

                case TOKEN:
                    spofityLoggedIn = true;

                    CredentialsHandler.setOperationType(MainActivity.this, "UploadingSong");
                    Clipeo.spotifyAccessToken = response.getAccessToken();
                    switchFragment(Main.newInstance());
                    break;

                // Auth flow returned an error
                case ERROR:
                    spofityLoggedIn = false;
                    logMessage("Auth error: " + response.getError());
                    break;

                default:
                    //MainActivity.spofityLoggedIn = false;
                    logMessage("Auth error: " + response.getError());
            }

Executing the above code always print an error "INVALID_APP_ID" in logcat.

Expected behaviour:
Spotify Authentication allows user to login and returns a success response.

Actual behaviour:
INVALID_APP_ID error is printed when user tries to login in with a Spotify account.

Successful tests:
Galaxy S8 (Android Oreo 8.0) and Google Nexus 7 (Android Nougat 7.1.1).

Getting player Queue

I want to be able to show a list of tracks that are in the current queue to my user.
Is there any way to achieve this? I cant seem to find anything in the java docs.
Thanks in advance

Update documentation to include potential missing dependencies

Issue found on August 9th, 2018

SDK Version:

0.4.0

OS Version:

N/A

Scope(s):

N/A

Issue:

The documentation found here lists the dependencies as follows:

dependencies { // your app dependencies compile project(':spotify-app-remote') compile "com.google.code.gson:gson:2.6.1" }

However, it would seem that without including Jackson as a dependency (even if you aren't using it) produces the following compilation error:

Failed to find byte code for com/fasterxml/jackson/databind/ser/std/StdSerializer

I resolved this issue by including the following dependencies:

compile 'com.fasterxml.jackson.core:jackson-core:2.7.3'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.3'

Does the documentation need to be updates to include these or am I missing something? Thanks!

Client authentication failed: INVALID_APP_ID

Issue found on 05/24/2018.

SDK Version: 0.4.0

OS Version: 7.1.1

Scope(s): app-remote-control

Steps to reproduce:

  1. Follow quickstart guide at https://beta.developer.spotify.com/documentation/android-app-remote/quick-start/
  2. Compile, send to device, and open App

Expected behaviour:

The library connects and starts to play music.

Actual behaviour:

The error Client authentication failed: INVALID_APP_ID is raised on logcat.

05-24 22:31:21.729 19446-19529/com.galaxia.galaxia W/art: Unable to resolve Lcom/spotify/protocol/types/Roles; annotation class 28
05-24 22:31:21.731 19446-19529/com.galaxia.galaxia W/art: Unable to resolve Lcom/spotify/protocol/types/Roles; annotation class 28
05-24 22:31:21.732 19446-19529/com.galaxia.galaxia W/art: Unable to resolve Lcom/spotify/protocol/types/Roles; annotation class 28
05-24 22:31:21.734 19446-19529/com.galaxia.galaxia W/art: Unable to resolve Lcom/spotify/protocol/types/Roles; annotation class 28
05-24 22:31:28.530 19446-19446/com.galaxia.galaxia D/RemoteServiceIo: Message from Spotify: [3,{"message":"Client authentication failed: INVALID_APP_ID"},"com.spotify.error.client_authentication_failed"]
05-24 22:31:28.557 19446-19446/com.galaxia.galaxia D/RemoteServiceIo: stop remote client
05-24 22:31:28.561 19446-19446/com.galaxia.galaxia E/MyActivity: {"message":"Client authentication failed: INVALID_APP_ID"}
                                                                 com.spotify.android.appremote.api.error.AuthenticationFailedException: {"message":"Client authentication failed: INVALID_APP_ID"}
                                                                     at com.spotify.android.appremote.api.LocalConnector.asAppRemoteException(LocalConnector.java:121)
                                                                     at com.spotify.android.appremote.api.LocalConnector.access$000(LocalConnector.java:36)
                                                                     at com.spotify.android.appremote.api.LocalConnector$1.onConnectionFailed(LocalConnector.java:108)
                                                                     at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:137)
                                                                     at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:75)
                                                                     at android.os.AsyncTask.finish(AsyncTask.java:667)
                                                                     at android.os.AsyncTask.-wrap1(AsyncTask.java)
                                                                     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:684)
                                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                     at android.os.Looper.loop(Looper.java:154)
                                                                     at android.app.ActivityThread.main(ActivityThread.java:6165)
                                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
                                                                  Caused by: com.spotify.protocol.client.error.RemoteClientException: {"message":"Client authentication failed: INVALID_APP_ID"}
                                                                     at com.spotify.protocol.client.RemoteWampClient.getRemoteClientException(RemoteWampClient.java:107)
                                                                     at com.spotify.protocol.client.RemoteWampClient.access$200(RemoteWampClient.java:14)
                                                                     at com.spotify.protocol.client.RemoteWampClient$1.onAbort(RemoteWampClient.java:36)
                                                                     at com.spotify.protocol.client.WampRouterImpl.routeAbort(WampRouterImpl.java:110)
                                                                     at com.spotify.protocol.client.WampRouterImpl.route(WampRouterImpl.java:32)
                                                                     at com.spotify.protocol.client.AppProtocolCommunicator.onData(AppProtocolCommunicator.java:76)
                                                                     at com.spotify.android.appremote.internal.RemoteServiceIo.handleMessage(RemoteServiceIo.java:118)
                                                                     at com.spotify.android.appremote.internal.RemoteServiceIo.access$000(RemoteServiceIo.java:47)
                                                                     at com.spotify.android.appremote.internal.RemoteServiceIo$IncomingHandler.handleMessage(RemoteServiceIo.java:96)
                                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                     at android.os.Looper.loop(Looper.java:154) 
                                                                     at android.app.ActivityThread.main(ActivityThread.java:6165) 
                                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888) 
                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778) 

Client authentication failed: INVALID_APP_ID

Issue found on 04/10/2018

SDK Version: v0.4.0

OS Version: android 8.0.1

Scope(s):

Steps to reproduce:

  1. Running this:
    `
    SpotifyAppRemote.CONNECTOR.connect(
    getApplication(),
    new ConnectionParams.Builder(CLIENT_ID)
    .setRedirectUri(REDIRECT_URI)
    .showAuthView(showAuthView)
    .build(),
    new Connector.ConnectionListener() {
    @OverRide
    public void onConnected(SpotifyAppRemote spotifyAppRemote) {
    mSpotifyAppRemote = spotifyAppRemote;
    Toast.makeText(getBaseContext(), "onConnected: connected !!!",Toast.LENGTH_LONG).show();
    connected();
    }

                 @Override
                 public void onFailure(Throwable error) {
                     Toast.makeText(getBaseContext(), "Connection failed: " +  error, Toast.LENGTH_LONG).show();
                     Log.d(TAG, "onFailure: " + error);
                 }
             });
    

`

Expected behaviour:

To be able to connect.

Actual behaviour:

Getting error:
Message from Spotify: [3,{"message":"Client authentication failed: INVALID_APP_ID"},"com.spotify.error.client_authentication_failed"]

Additional info:

I added the Android Package Name, SHA1 Fingerprint and the redirect uri to the settings

Sample crash

Thanks for your interest in the Spotify App Remote SDK!
If you're submitting a bug, please use the following template.
If your issue is a feature request, please include your use-case so that we have all the necessary info.

Issue found on 09/27/2018.

SDK Version: 0.4.0

OS Version: Android 7

Scope(s):

Steps to reproduce:

  1. clone SDK
  2. Fill clientId and redirectUri in Sample's MainActivity
  3. Start App
  4. Click on "Request Token"

Expected behaviour:

App should go to login

Actual behaviour:

09-27 14:22:16.332 16062 16062 E AndroidRuntime: Process: com.spotify.sdk.android.authentication.sample, PID: 16062 09-27 14:22:16.332 16062 16062 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/customtabs/CustomTabsIntent$Builder; 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at com.spotify.sdk.android.authentication.CustomTabAuthHandler.start(CustomTabAuthHandler.java:69) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at com.spotify.sdk.android.authentication.AuthenticationClient.tryAuthenticationHandler(AuthenticationClient.java:505) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at com.spotify.sdk.android.authentication.AuthenticationClient.authenticate(AuthenticationClient.java:430) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at com.spotify.sdk.android.authentication.LoginActivity.onCreate(LoginActivity.java:112) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6955) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at android.app.ActivityThread.-wrap14(ActivityThread.java) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6776) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) 09-27 14:22:16.332 16062 16062 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.customtabs.CustomTabsIntent$Builder"

Fix:

I just added
implementation "com.android.support:customtabs:$supportLibVersion"
in sample's build.gradle dependencies (https://github.com/spotify/android-sdk/blob/master/auth-sample/build.gradle)

ads that have swearing

Thanks for your interest in the Spotify App Remote SDK!
If you're submitting a bug, please use the following template.
If your issue is a feature request, please include your use-case so that we have all the necessary info.

I have Explicit content turned off on my account and over the course of the last couple of weeks I have heard ads that contain offensive language. I would much rather that this issue does not continue on my account. The Metal AF ad is the one that is causing the most issues.

Invalid URI is provided via PlayerContext thus causing an Exception

SDK Version: 0.4.0

OS Version: 8.1.0

Not all playable items pass validation.

  • Playlist. Some times i get playlist with used id. Valid playlist looks like this spotify:user:spotify:playlist:37i9dQZF1DWXqpDKK4ed9O here user is spotify and this means it is public. But sometime I get spotify:playlist:37i9dQZF1DWXqpDKK4ed9O with no user. I had this issue with ""90s Love Songs"" but later it got fixed after 2-3 days. It was pretty random

  • Tracks. A valid track uri should look like this spotify:track:0DiWol3AO6WpXZgp0goxAV.
    BUT! It actually looks like this spotify:station:track:0DiWol3AO6WpXZgp0goxAV. It has ""station"" word in there. Why?"

Can't load albums

Thanks for your interest in the Spotify App Remote SDK!
If you're submitting a bug, please use the following template.
If your issue is a feature request, please include your use-case so that we have all the necessary info.

Issue found on november.

SDK Version:

OS Version: Latest (november 2018).

Scope(s):

Steps to reproduce:

Expected behaviour: I don't understand what you want above, but I have a Sony XZ Premium, and use the Spotify app. I have the latest OS, but don't know the name.

What I want is, when I go to an album from an artist or from Search, I of course want to see the content.

Actual behaviour: The app just starts loading, and all I see is a green turning circle. I have searched the forum and found many others who have the samt issue, but no answer from Spotify when or what to do to fix it. Uninstall and reinstall helps for the moment, but the issue returns. Please fix!!

SDK causes zygote annotation log spam

SDK Version: 0.4.0

OS Version: 8.1.0

Spotify Version: 8.4.67.866 armV7

Steps to reproduce:

  1. Connect to the Spotify via SpotifyAppRemote.CONNECTOR.connect() and play URI with SpotifyAppRemote.play()

Expected behaviour:

SDK should keep logcat fairly clean

Actual behaviour:

Logcat is filled with messages like these:

W/zygote64: Unable to resolve Lcom/spotify/protocol/types/HelloDetails; annotation class 3177
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/HelloDetails; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/HelloDetails; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/HelloDetails; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/HelloDetails; annotation class 3180
I/chatty: uid=10222(com.matejdro.taskerspotifystarter) AsyncTask #1 identical 3 lines
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/HelloDetails; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3177
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3180
I/chatty: uid=10222(com.matejdro.taskerspotifystarter) AsyncTask #1 identical 3 lines
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3180
I/chatty: uid=10222(com.matejdro.taskerspotifystarter) AsyncTask #1 identical 3 lines
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3180
I/chatty: uid=10222(com.matejdro.taskerspotifystarter) AsyncTask #1 identical 1 line
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3180
I/chatty: uid=10222(com.matejdro.taskerspotifystarter) AsyncTask #1 identical 5 lines
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Info; annotation class 3180
    Unable to resolve Lcom/spotify/protocol/types/HelloDetails; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/HelloDetails; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Roles; annotation class 3177
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Roles; annotation class 3180
I/chatty: uid=10222(com.matejdro.taskerspotifystarter) AsyncTask #1 identical 2 lines
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Roles; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Roles; annotation class 3180
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Roles; annotation class 3180
I/chatty: uid=10222(com.matejdro.taskerspotifystarter) AsyncTask #1 identical 1 line
W/zygote64: Unable to resolve Lcom/spotify/protocol/types/Roles; annotation class 3180

Can't make Broadcast Status work

I'm trying to replicate the official documentation guide to make broadcast types work, but no success.
I'm trying since last week.

OS Version: API 27 (Android Oreo)
Spotify Version: 8.4.70.666

  1. Followed as recommended on https://developer.spotify.com/documentation/android/guides/android-media-notifications/;
  2. Broadscast Class registred in Manifest file;
  3. Toast coded in class to identify music changes;
  4. Device Broadcast Status Enabled as bellow;

screenshot_spotify_20180923-225741

Expected behaviour:
As the guide suggested i would be able to identify changes on spotify songs to work with tracks and stuff to put on my application (Car Dashboard), but no success. I can make it work by the internet, via api, but without success with the broadcast status.

Actual behaviour:

It seems not be able to identify the changes. Bellow, has my broadcast class and my Manifest file:
Class_

package phpmysql.app.ffro3.php_mysql;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class MyBroadcastReceiver extends BroadcastReceiver{

static final class BroadcastTypes {
    static final String SPOTIFY_PACKAGE = "com.spotify.music";
    static final String PLAYBACK_STATE_CHANGED = SPOTIFY_PACKAGE + ".playbackstatechanged";
    static final String QUEUE_CHANGED = SPOTIFY_PACKAGE + ".queuechanged";
    static final String METADATA_CHANGED = SPOTIFY_PACKAGE + ".metadatachanged";
}

@Override
public void onReceive(Context context, Intent intent) {
    // This is sent with all broadcasts, regardless of type. The value is taken from
    // System.currentTimeMillis(), which you can compare to in order to determine how
    // old the event is.

    Toast toast = Toast.makeText(context, "Broadcast funcionando corretamente", Toast.LENGTH_SHORT);
    toast.show();
    long timeSentInMs = intent.getLongExtra("timeSent", 0L);

    Toast.makeText(context, String.valueOf(timeSentInMs), Toast.LENGTH_LONG).show();


    String action = intent.getAction();

    if (action.equals(BroadcastTypes.METADATA_CHANGED)) {
        String trackId = intent.getStringExtra("id");
        String artistName = intent.getStringExtra("artist");
        String albumName = intent.getStringExtra("album");
        String trackName = intent.getStringExtra("track");
        int trackLengthInSec = intent.getIntExtra("length", 0);
        // Do something with extracted information...
        Toast toasty = Toast.makeText(context, "Broadcast ouviu a mudanca corretamente", Toast.LENGTH_SHORT);
        toasty.show();
    } else if (action.equals(BroadcastTypes.PLAYBACK_STATE_CHANGED)) {
        boolean playing = intent.getBooleanExtra("playing", false);
        int positionInMs = intent.getIntExtra("playbackPosition", 0);
        // Do something with extracted information
    } else if (action.equals(BroadcastTypes.QUEUE_CHANGED)) {
        // Sent only as a notification, your app may want to respond accordingly.
    }
}

}

AndroidManifest.xml_

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>



<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="Corsadroid"
    android:roundIcon="@mipmap/ic_launcher"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <meta-data
        android:name="com.google.android.gms.car.application"
        android:resource="@xml/automotive_app_desc" />


    <activity
        android:name=".Home_Activity"
        android:label="@string/title_activity_home_"
        android:windowSoftInputMode="adjustPan" />
    <activity
        android:name=".ScrollingActivity"
        android:label="@string/title_activity_scrolling" />
    <activity android:name=".itemUsuario" />
    <activity android:name=".User_details" />
    <activity android:name=".CarHome" />
    <activity android:name=".Playlist" />
    <activity android:name=".nowPlaying" />


    <receiver android:name=".BroadcastMessage">

        <intent-filter>
            <action android:name="android.intent.action.AIRPLANE_MODE" />
        </intent-filter>

    </receiver>


</application>

I'm missing something? The Broadcast Status isn't being sent by spotify app in this version?

Thanks

Client Credentials Flow

I'm trying to login an Spotify App into my Android app but i can't find any method for login with Client Credentials Flow.

I've searched in the SDK and in the WebAPI Libs and nothing seems to include Client Credentials Flow

Some help?

Is raw waveform provided in new Android remote sdk?

Hi,

Is there a way of getting raw waveform from new spotify remote SDK like the 2014 SDK had a player from which raw waveform can be extracted? I have gone through the SDK and couldn't find it.

Is there any chance that the old 2014 spotify-player will be deprecated or will stop providing raw waveforms to its client?

x

x

Single sign-on how to

I have a running app integrated with Spotify Authentication flow via web login so I already have a token. Docs says I can use this token to user app remote sdk but I don't get how.

ConnectionParams doesn't seem to have a way to set the token. How should I give this params my token?

How to clear queue?

I'm finding a way to clear all songs from queue but couldn't find it. Can we have this feature in the future? Thank you.

Failed to find byte code for com/fasterxml/jackson/databind/deser/std/StdDeserializer

I receive this error upon trying to compile a SampleApp.

Here's my dependencies

implementation project(':spotify-app-remote-release-0.4.0')
implementation "com.google.code.gson:gson:2.8.5"

Here's my mainactivity onStart (np other code)

```

@OverRide
protected void onStart() {
super.onStart();

    // Set the connection parameters
    ConnectionParams connectionParams =
            new ConnectionParams.Builder(CLIENT_ID)
                    .setRedirectUri(REDIRECT_URI)
                    .showAuthView(true)
                    .build();


    SpotifyAppRemote.CONNECTOR.connect(this, connectionParams,
            new Connector.ConnectionListener() {

                @Override
                public void onConnected(SpotifyAppRemote spotifyAppRemote) {
                    mSpotifyAppRemote = spotifyAppRemote;
                    Log.d("MainActivity", "Connected! Yay!");

                    // Now you can start interacting with App Remote
                    connected();
                }

                @Override
                public void onFailure(Throwable throwable) {
                    Log.e("MainActivity", throwable.getMessage(), throwable);

                    // Something went wrong when attempting to connect! Handle errors here
                }
            });
    // We will start writing our code here.
}

IDeas anyone?

How to detect when a song ends

Is there a way we can detect when a song ends?

I'm trying to create some sort of custom queue, as I couldn't find any way to modify the queue, any pointers as to how this can be achieved?

Thanks

Issues connecting, "INVALID_CLIENT"

Issue found on 2018-11-14.

SDK Version: 27

OS Version: Android 8.1.0

Scope(s): spotify-app-remote

Steps to reproduce:

  1. Follow Android SDK Quick Start
  2. Debug application

Expected behaviour:

App connects to Spotify player and receives information about player state.

Actual behaviour:

App connects 5-10 % of the time, the rest of the time it gets an error message with the message "Client authentication failed: INVALID_CLIENT". I'm using the client id I've received on the developer dashboard, and 'com.lordoscar.spotimote://callback' as redirect uri. I've also registered the fingerprint on the developer dashboard, so that shouldnt be the issue either.

E/MainActivity: {"message":"Client authentication failed: INVALID_CLIENT"} com.spotify.android.appremote.api.error.AuthenticationFailedException: {"message":"Client authentication failed: INVALID_CLIENT"} at com.spotify.android.appremote.api.LocalConnector.asAppRemoteException(LocalConnector.java:126) at com.spotify.android.appremote.api.LocalConnector.access$000(LocalConnector.java:38) at com.spotify.android.appremote.api.LocalConnector$1.onConnectionFailed(LocalConnector.java:113) at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:152) at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:86) at android.os.AsyncTask.finish(AsyncTask.java:695) at android.os.AsyncTask.-wrap1(Unknown Source:0) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6753) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:482) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by: com.spotify.protocol.client.error.RemoteClientException: {"message":"Client authentication failed: INVALID_CLIENT"} at com.spotify.protocol.client.RemoteWampClient.getRemoteClientException(RemoteWampClient.java:111) at com.spotify.protocol.client.RemoteWampClient.access$200(RemoteWampClient.java:14) at com.spotify.protocol.client.RemoteWampClient$1.onAbort(RemoteWampClient.java:38) at com.spotify.protocol.client.WampRouterImpl.routeAbort(WampRouterImpl.java:110) at com.spotify.protocol.client.WampRouterImpl.route(WampRouterImpl.java:32) at com.spotify.protocol.client.AppProtocolCommunicator.onData(AppProtocolCommunicator.java:76) at com.spotify.android.appremote.internal.RemoteServiceIo.handleMessage(RemoteServiceIo.java:115) at com.spotify.android.appremote.internal.RemoteServiceIo.access$000(RemoteServiceIo.java:50) at com.spotify.android.appremote.internal.RemoteServiceIo$IncomingHandler.handleMessage(RemoteServiceIo.java:93)

"APP_NAME is connected" notification never goes away

Issue found on Sep 26 2018.

SDK Version: 0.4.0

OS Version: 8.1.0

Scope(s): Always

Steps to reproduce:

  1. Open my app
  2. Verify app has connected to Spotify and has received track info etc. Notice that there is now an ongoing notification stating "APP_NAME is connected"
  3. Stop my app.
  4. The ongoing notification is still there

Expected behavior: The ongoing notification should go away when my app disconnects (or better would be that the ongoing notification never appears in the first place).

Actual behavior: When my app connects to Spotify, a new ongoing notification appears. I assume this is issued by the Spotify app although it might be from the SDK. Selecting this notification does nothing. The problem is, even when my app is stopped and has disconnected from Spotify, this notification does not go away.

Jump to track in the context of an album

This is not a bug, it's more a feature request - but perhaps this is already possible and I just didn't see how to do it.

I want to store the current position in a track to be able to lateron resume at the same position. Getting information about position and current track is easy, the same is resuming.
The problem which I am currently are unable to solve is that I want the context of the track to stay the same so that the subsequent track played is the same as it would have been when playing without interruption.

Is there any way to do this with the current SDK?

I am using version 0.4.0 on Android 8 with the most recent version of the Spotify app for Android.

Thanks for your help!

RemoteClientException: {"message":"Client authentication failed: INVALID_CLIENT"}

I have the proper client id. What gives?

    SpotifyAppRemote.CONNECTOR.connect(this, connectionParams,
            new Connector.ConnectionListener() {

                @Override
                public void onConnected(SpotifyAppRemote spotifyAppRemote) {
                    mSpotifyAppRemote = spotifyAppRemote;
                    Log.d("MainActivity", "Connected! Yay!");

                    // Now you can start interacting with App Remote
                    connected();
                }

                @Override
                public void onFailure(Throwable throwable) {
                    Log.e("MainActivity",  throwable.getMessage(), throwable);

                    // Something went wrong when attempting to connect! Handle errors here
                }
            });

The onFailureThrowable is called.

access token error

        AuthenticationRequest.Builder builderx =
                new AuthenticationRequest.Builder(clientId, AuthenticationResponse.Type.TOKEN, REDIRECT_URI);

        builderx.setScopes(new String[]{"streaming"});
        AuthenticationRequest request = builderx.build();

        AuthenticationClient.openLoginActivity(this, REQUEST_CODE, request);

This gets me this error: AUTHENTICATION_SERVICE_UNKNOWN_ERROR

Support offline mode after app authenticates once

At the moment app needs online internet connection to connect to the Spotify. This is pretty limiting, if user is, for example in a tunnel or in other low-signal zone or abroad in roaming mode.

Yes, controlling app could connect once and keep connection established for ever, but that would waste ram unnecessarily since app would need to have constantly running background service.

So my proposal: once app gets authenticated once, cache its credentials locally on the user's device, and periodically renew that cache (similar to how global offline mode works for Spotify where you can listen to offline for 30 days, but then must come online once for auth check). That way all controllers can securely connect in all environments.

Offline Playing: What is possible?

In the readme you write:

While certain playback controls work offline and playback can happen offline for offlined content, apps cannot connect and start communicating with Spotify unless there is an internet connection

What does that mean?

I am thinking about making a Spotify alarm clock that must work offline. What would that mean for the apps possible offline capabilities?

Images failing to load with ImagesApi

Issue found on 4/19/2018.

SDK Version: 0.4.0

OS Version: Android 8.0.0

Scope(s): user-read-private, app-remote-control

Steps to reproduce:

  1. Register a subscription listener to the player state
  2. When state is received, and if track is found to be non-null, attempt to load image using spotifyAppRemote.getImagesApi().getImage(track.imageUri)

Expected behavior:

Image should load and be returned to the result callback. Image URI appears to be correctly provided by track.

Actual behavior:

Callback error is supplied, giving very little info to what went wrong with loading the image.

com.spotify.protocol.client.error.RemoteClientException: {"message":"Failed to load image."}
        at com.spotify.protocol.client.RemoteWampClient.getRemoteClientException(RemoteWampClient.java:107)
        at com.spotify.protocol.client.RemoteWampClient.access$200(RemoteWampClient.java:14)
        at com.spotify.protocol.client.RemoteWampClient$1.onError(RemoteWampClient.java:85)
        at com.spotify.protocol.client.WampRouterImpl.routeError(WampRouterImpl.java:85)
        at com.spotify.protocol.client.WampRouterImpl.route(WampRouterImpl.java:52)
        at com.spotify.protocol.client.AppProtocolCommunicator.onData(AppProtocolCommunicator.java:76)
        at com.spotify.android.appremote.internal.RemoteServiceIo.handleMessage(RemoteServiceIo.java:118)
        at com.spotify.android.appremote.internal.RemoteServiceIo.access$000(RemoteServiceIo.java:47)
        at com.spotify.android.appremote.internal.RemoteServiceIo$IncomingHandler.handleMessage(RemoteServiceIo.java:96)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6938)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Not receiving SpotifyConnectionTerminatedException on Interface Connector.ConnectionListener -- onFailure callback doesn't work.

SDK Version: 0.4.0

OS Version: 8.1.0

Steps to reproduce:

Pre-conditions: App is appropriately connected to Spotify via the SDK, and music is currently playing.

  1. Open Spotify
  2. Kill Spotify app

Expected behaviour:

According to Spotify documentation, we should receive SpotifyConnectionTerminatedException on Interface Connector.ConnectionListener, but the onFailure method is not being called.

Actual behaviour:

When we manually kill Spotify app, we are not getting any callback from the SDK about this.

Can play Album playlist,but not track

Issue found on DATE.
Nov 10,2018

SDK Version: 0.5.0

OS Version: Window 10

Scope(s):"streaming","playlist-read-private","user-read-recently-played","user-read-currently-playing",

    "playlist-read-collaborative","user-library-read","app-remote-control","user-read-playback-state","user-top-read"

Steps to reproduce:

1)use PlayerApi to play songs from album with uri "spotify:album:{album id}"
2)Play normally.
3)use PlayerApi to play the track directly with uri "spotify:track:{track id}"
4)Track not play at all

Expected behaviour:

PlayerApi able to play both the track directly and the album playlist.

Actual behaviour:

The track not starting,but album play normally.

Non premium users

Most Spotify SDK/API endpoints have been premium only.

Any chance this SDK could also support non premium users? It's a hassle to write an alternate implementation with hacky intents and notification listeners for non premium users...

There's no need for additional methods to check if an user is a premium user or non premium user exceptions, I don't mind checking the subscription of an user with the web API. I just would like to be able to keep track of the playback state and start shuffle playback of a certain playback context. Obviously there are some edge cases like tablets though.

Get tracks from current playlist or album

If the player is playing a playlist or album is there a way to get all the tracks in it? I can't see one, it would be very useful in order to create a UI to show the next songs that will be played.

Will raw audio delivery function will ever be stopped?

  • Will Spotify ever stop delivering raw audio waveform through onAudioDataDelivered function?
  • Is it allowed to apply processing effects on raw audio waveform obtained from Spotify and sell it as an application to clients? What are the procedures for that on the developer's side?

how to get access token

Hi. I'm trying to use Web API with a an android wrapper class that uses retrofit.

Unless of course, it's possible to create playlists using the given android-sdk.

My question is this:

        SpotifyAppRemote.CONNECTOR.connect(this, connectionParams,

                new Connector.ConnectionListener() {

                    @Override
                    public void onConnected(SpotifyAppRemote spotifyAppRemote) {
                        mSpotifyAppRemote = spotifyAppRemote;
                        Log.d("TESTX", "Connected! Yay!");

               

                    }

                    @Override
                    public void onFailure(Throwable throwable) {
                        Log.e("TESTX", "ERROR: " + throwable.getMessage(), throwable);

                        // Something went wrong when attempting to connect! Handle errors here
                    }
                }
                );

How do I access the auth_token now that I've been "Connected! Yay!" ??? I need it for the web api.

AUTHENTICATION_SERVICE_UNKNOWN_ERROR - but only sometimes ??

Hi there! This error only occures sometimes, i am very confused. I dont remember this error, it must be new.. i dont know.. maybe with the last spotify updates?

SDK Version: Android SDK v0.5.0 AppRemote v1.1.0 Auth

OS Version: 8.0.0 / "Samsung Experience-Version 9.0" (Device is Samsung Galaxy A3)

Scope(s):

            "app-remote-control",
            "playlist-read-private",
            "playlist-modify-private",
            "playlist-modify-public",
            "user-read-private",
            "streaming",
            "user-top-read",
            "user-modify-playback-state",
            "user-read-currently-playing",
            "user-read-playback-state"

Steps to reproduce:

ONLY SOMETIMES:

  1. Connect to Spotify using the documented Connecting Flow in Android

Expected behaviour:

  • The connections to spotify is established and my app is ready to play a track

Actual behaviour:

  • The connection is NOT established. The onFailure() Method is triggered and the Exception is an instance of SpotifyAppRemoteException. The throwable message is {"message":"Client authentication failed: AUTHENTICATION_SERVICE_UNKNOWN_ERROR"}

Thank you very much for helping me

Track can't be added to queue

I'am using the remote sdk to try to add a track to the current queue playback but nothing happens.

Tested in different devices:

  • Bug found on: 2018/04/11
  • SDK Version: 0.4.0
  • Spotify free account (no premium)
  • OS Versions:
    Android 8.0.0 One Plus 5T
    Android 5.1 Motorola Moto G first generation
  • No scopes used

My code is the following:

    ConnectionParams connectionParams =
            new ConnectionParams.Builder(CLIENT_ID)
                    .setRedirectUri(REDIRECT_URI)
                    .showAuthView(true)
                    .build();

    SpotifyAppRemote.setDebugMode(true);
    SpotifyAppRemote.CONNECTOR.connect(this, connectionParams,
            new Connector.ConnectionListener() {

                public void onConnected(SpotifyAppRemote spotifyAppRemote) {
                    mSpotifyAppRemote = spotifyAppRemote;
                }
            });

    btnQueue.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Log.d(TAG, "Queuing track in progress...");
            CallResult<Empty> result = mSpotifyAppRemote.getPlayerApi().queue("spotify:track:1YmVP8YHML5GmTz2olx7nA");
            result.setResultCallback(new CallResult.ResultCallback<Empty>() {
                @Override
                public void onResult(Empty empty) {
                    Log.d(TAG, "Track queued");
                }
            });

            result.setErrorCallback(new ErrorCallback() {
                @Override
                public void onError(Throwable throwable) {
                    Log.e(TAG, "Error queueing track");
                }
            });
        }
    });

When I click the button "queue a track", result callback is called, "Track queued" printed on log, but the track isn't in the queue playback.

The steps I'am following are the next:

  1. I open Spotify in my Laptop and play a track.
  2. I open Spotify in my mobile to control the Laptop session.
  3. I open my app in the same mobile and I click the button "add track to queue" but nothing happens. No error in log or throw by the sdk.

My app can pause and resume the track playing in the computer without problems but not queuing a track. The queue functionality is a great feature and I wish I'll can used it in my app.

AuthenticationFailedException : AUTHENTICATION_SERVICE_UNAVAILABLE

Thanks for your interest in the Spotify App Remote SDK!
If you're submitting a bug, please use the following template.
If your issue is a feature request, please include your use-case so that we have all the necessary info.

Issue found on DATE. 5/31/2018

SDK Version: spotify-app-remote-release-0.3.0 ; spotify-auth:1.0.0-beta13

OS Version: Android version 8

Scope(s): app-remote-control

Steps to reproduce:

  1. Not able to Authenticate client app
  2. Below code sometimes does not authenticate .
AuthenticationRequest.Builder builder = new AuthenticationRequest.Builder(CLIENT_ID, AuthenticationResponse.Type.CODE, REDIRECT_URI);
builder.setScopes(new String[]{"app-remote-control"});
AuthenticationRequest request = builder.build();
Intent intent = LoginActivity.getAuthIntent(context, request);
startActivityForResult(intent, REQUEST_CODE);

Expected behaviour:

Actual behaviour:

throwing below exception :

com.spotify.android.appremote.api.error.AuthenticationFailedException: {"message":"Client authentication failed: AUTHENTICATION_SERVICE_UNAVAILABLE"}
at com.spotify.android.appremote.api.LocalConnector.asAppRemoteException(LocalConnector.java:121)
at com.spotify.android.appremote.api.LocalConnector.access$000(LocalConnector.java:36)
at com.spotify.android.appremote.api.LocalConnector$1.onConnectionFailed(LocalConnector.java:108)
at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:135)
at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:74)
at android.os.AsyncTask.finish(AsyncTask.java:695)
at android.os.AsyncTask.-wrap1(Unknown Source:0)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

anscash's little helper: IllegalArgumentException

Thanks for your interest in the Spotify App Remote SDK!
If you're submitting a bug, please use the following template.
If your issue is a feature request, please include your use-case so that we have all the necessary info.

Issue found on DATE.

SDK Version: Android SDK v0.5.0 AppRemote v1.1.0 Auth

OS Version: 8.0.0 / "Samsung Experience-Version 9.0" (Device is Samsung Galaxy A3)

Scope(s):

"app-remote-control", "playlist-read-private", "playlist-modify-private", "playlist-modify-public", "user-read-private", "streaming", "user-top-read", "user-modify-playback-state", "user-read-currently-playing", "user-read-playback-state"

Steps to reproduce:

  1. Connect to Spotify Remote SDK using the Workflow described on the website
  2. Play a Track by Id

Expected behaviour:

  1. The Playback starts

Actual behaviour:

  1. The Playback does not start

In Debug mode, i can find this stacktrace in my log:
2018-11-13 00:01:05.058 922-922/? E/Spotify: [main] Failed to load image with uri: "". java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but no colon was found at zda.a(SourceFile:1325) at zcz.f(SourceFile:916) at zdm.a(SourceFile:165) at gcl.a(SourceFile:121) at xgy.a(SourceFile:44) at xlp.a(SourceFile:206) at xlp.run(SourceFile:159) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764) at xng.run(SourceFile:411)

This error often happens when i've just opened my app and push my playback-button. If i try it again, it usually works. So this is not that bad at all, but i also want to help you guys from spotify. I would love to use the android sdk in a no-betaVersion-way

Greetings ancash

P.S. Iam using a callback which detects when the Connect-Method finishes... If the callback is triggered, the playback starts. (Press Button -> Connect to SDK -> Callback -> Play Track) Maybe this is the painpoint. This is all information i can give you to help

Starting playback with screen off sometimes start Spotify in detached-from-Android mode

SDK Version: 0.4.0

OS Version: 8.1.0

Spotify Version: 8.4.67.866 armV7

Steps to reproduce:

  1. Spotify should be in stopped/paused state
  2. Connect to the Spotify via SpotifyAppRemote.CONNECTOR.connect() and play playlist URI with SpotifyAppRemote.play() while screen is off and locked

Expected behaviour:

Spotify should always start normally, with MediaSession and notification, even when screen is off.

Actual behaviour:

Sometimes, Spotify will start in sort of detached-from-Android mode, where audio is playing, but Android System (and other apps) have no idea that it is actually playing. Symptoms of this mode include:

  • There is no active Android MediaSession for Spotify
  • There is no playback notification from Spotify
  • Other devices (such as connected smartwatches) do not see any playback
  • Pressing bluetooth buttons will not affect Spotify, but it will just start playing next media app as if Spotify is not there at all
  • Spotify is not respecting audio focus - another app can start playback and it would just play simultaneously with music from Spotify

Fixing this is pretty simple - I just have to turn on the screen, unlock the device and open Spotify app manually. After that Spotify's notification pops up immediately and normal operation resumes.

However, my main use case for this SDK is starting playback while phone is locked in my pocket. And having to sometimes take phone out to manually to fix it does cause some annoying usability problems.

Spotify sometimes enter stuck state where connection always times out

SDK Version: 0.4.0

OS Version: 8.1.0

Spotify Version: 8.4.67.866 armV7

Steps to reproduce:

Execute this code:

val connectionParams = ConnectionParams.Builder(BuildConfig.SPOTIFY_CLIENT_ID)
        .setRedirectUri(SpotifyConstants.REDIRECT_URI)
        .showAuthView(true)
        .build()

SpotifyAppRemote.CONNECTOR.connect(context, connectionParams, object : Connector.ConnectionListener {
    override fun onFailure(error: Throwable) {
        println("Failure")
        error.printStackTrace()
    }

    override fun onConnected(remote: SpotifyAppRemote) {
        println("Connected")
    }
})

When doing this, there is a chance that Spotify app will be in stuck state, where connection to it will always time out, even through multiple connection attempts.

Expected behaviour:

Spotify connection should succeed and onConnected should be called.

Actual behaviour:

  • <App Name> is connecting notification from Spotify app may or may not appear (I have experienced both, but other symptoms are the same)
  • After couple of seconds notification disappears and onFailure is triggered with timeout exception.
  • Full Log output (with #15 spam filtered out) when issue occurs:
21:03:51.726 D/RemoteServiceIo: start remote client
21:03:51.742 D/RemoteServiceIo: Connecting to Spotify service
21:03:51.761 D/RemoteServiceIo: Spotify service connected
21:04:52.331 D/RemoteServiceIo: Message from Spotify: [3,{"message":"Internal error: TimeoutException"},"com.spotify.error.client_authentication_failed"]
21:04:52.342 D/RemoteServiceIo: stop remote client
21:04:52.354 I/System.out: Failure
21:04:52.357 W/System.err: com.spotify.android.appremote.api.error.AuthenticationFailedException: {"message":"Internal error: TimeoutException"}
21:04:52.367 W/System.err:     at com.spotify.android.appremote.api.LocalConnector.asAppRemoteException(LocalConnector.java:121)
21:04:52.370 W/System.err:     at com.spotify.android.appremote.api.LocalConnector.access$000(LocalConnector.java:36)
        at com.spotify.android.appremote.api.LocalConnector$1.onConnectionFailed(LocalConnector.java:108)
        at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:137)
21:04:52.371 W/System.err:     at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:75)
        at android.os.AsyncTask.finish(AsyncTask.java:695)
        at android.os.AsyncTask.-wrap1(Unknown Source:0)
21:04:52.372 W/System.err:     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6499)
21:04:52.373 W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
    Caused by: com.spotify.protocol.client.error.RemoteClientException: {"message":"Internal error: TimeoutException"}
21:04:52.375 W/System.err:     at com.spotify.protocol.client.RemoteWampClient.getRemoteClientException(RemoteWampClient.java:107)
        at com.spotify.protocol.client.RemoteWampClient.access$200(RemoteWampClient.java:14)
21:04:52.376 W/System.err:     at com.spotify.protocol.client.RemoteWampClient$1.onAbort(RemoteWampClient.java:36)
        at com.spotify.protocol.client.WampRouterImpl.routeAbort(WampRouterImpl.java:110)
        at com.spotify.protocol.client.WampRouterImpl.route(WampRouterImpl.java:32)
        at com.spotify.protocol.client.AppProtocolCommunicator.onData(AppProtocolCommunicator.java:76)
        at com.spotify.android.appremote.internal.RemoteServiceIo.handleMessage(RemoteServiceIo.java:118)
        at com.spotify.android.appremote.internal.RemoteServiceIo.access$000(RemoteServiceIo.java:47)
        at com.spotify.android.appremote.internal.RemoteServiceIo$IncomingHandler.handleMessage(RemoteServiceIo.java:96)
21:04:52.377 W/System.err: 	... 6 more

Only fix I found for that is to force stop Spotify app. After doing so, next connection attempt succeeds immediately. My current workaround for this issue is to force-stop Spotify app before every connection attempt (very ugly workaround, I want to get rid of it ASAP, but it does the job).

I have no idea how exactly Spotify gets into that state. I experienced it after just playing the music and after it was idle for hours so I'm not sure if any battery saving stuff can cause this. Also, at the time of connecting, my phone definitely HAS internet connection (I browsed the internet on my phone while waiting for my control app to unsuccessfully connect and start music).

Unexpected behavior in an Android Auto app

Thanks for your interest in the Spotify App Remote SDK!
If you're submitting a bug, please use the following template.
If your issue is a feature request, please include your use-case so that we have all the necessary info.

Issue found on September 27, 2018

SDK Version: 0.4.0

OS Version: Android 8.0.0

Scope(s): app-remote-control

Steps to reproduce:

  1. Create an Android Auto application.
  2. Within this Android Auto application, use SpotifyAppRemote and and PlayerApi to play an album.

Expected behaviour:

Android Auto app remains the current media streaming app, with Spotify music playing through a backgrounded process.

Actual behaviour:

Spotify app becomes the current Android Auto streaming app, music plays through Spotify.

Get song picture to imageview

SDK Version: 0.5

OS Version: 8.1

Scope(s):

I've tried to get image of the current song playing but the documentation is a bit hard to understand.
I get track image uri via "track.ImageUri" but how do I apply that image to my ImageView?

Crossfade Controls

It would be great to temporarily change a spotify user's crossfade settings from this api.

connect method not work

Issue found on 17/10/2018.

SDK Version:

0.5.0

OS Version:

android 7

Scope(s):

connect

Steps to reproduce:

  1. download sample app
  2. click connect

Expected behaviour:

opens Spotify app if installed to authorize

Actual behaviour:

i got this message
Can't connect to Spotify service with package com.spotify.music

Stop Spotify remote playing on every device

Issue found on 09/12/2018.

SDK Version:

0.4.0

OS Version:

Android 6.0 and Android 8.1.0

Scope(s):

Steps to reproduce:

  1. Connect two devices to the spotify remote SDK (the two devices are not on the same network)
  2. On one device use the method mSpotifyAppRemote.getPlayerApi().play(uri)
  3. The music is also starting on the other device

Expected behaviour:

The Spotifiy Remote SDK plays the song only on the Android device running the method mSpotifyAppRemote.getPlayerApi().play(uri).

Actual behaviour:

The potifiy Remote SDK plays the song on every device in the world connected with the Spotify Remote SDK using the same authentification info.

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.