Announcements

Help Wizard

Step 1

NEXT STEP

[AAOS] Missing functionality in spotify app for Android Automotive OS

Solved!

[AAOS] Missing functionality in spotify app for Android Automotive OS

Hello Spotify 👋
I work on media application for ANDROID AUTOMOTIVE OS (AAOS). And following requirements I should add features to take data from spotify Web Api(based on current song) then try to play something and handle spotify playback via remote media lib App Remote SDK (https://developer.spotify.com/documentation/android/guides/application-lifecycle/) by request from user.

 

It’s impossible to do that with App Remote SDK because sdk can’t connect to media service in spotify client for AAOS. The classes are missing for binding to media service. I’ve attached log below.


BTW, SpotifyAppRemote.connect(context, params, listener) works well on android for phones/tablets.

 

Let me know if you need code examples.

 

I need functionality to handle playback for AAOS version of spotify app.

 

FYI: ANDROID AUTOMOTIVE OS has a bit different approach for apps instead of ANDROID AUTO. Apps on AAOS can work without phone.

Difference between android auto and android automotive:
https://source.android.com/devices/automotive/start/what_automotive#android-automotive-android-auto

 

Error stack trace that SpotifyAppRemote.connect(context, params, listener) returns after attempt to connect:

 

 

2021-01-26 18:24:28.803 28824-28824/com.alexnuts.playground.spotify E/HomeViewModel$listener: :::HomeViewMode::listener::onFailure
    com.spotify.android.appremote.api.error.CouldNotFindSpotifyApp
        at com.spotify.android.appremote.api.LocalConnector.connect(LocalConnector.java:53)
        at com.spotify.android.appremote.api.SpotifyAppRemote.connect(SpotifyAppRemote.java:74)
        at com.alexnuts.playground.spotify.HomeViewModel.<init>(HomeViewModel.kt:56)
        at com.alexnuts.playground.spotify.di.KoinDIKt$moduleViewModel$1$1.invoke(KoinDI.kt:63)
        at com.alexnuts.playground.spotify.di.KoinDIKt$moduleViewModel$1$1.invoke(Unknown Source:4)
        at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:53)
        at org.koin.core.instance.FactoryInstanceFactory.get(FactoryInstanceFactory.kt:36)
        at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:103)
        at org.koin.core.scope.Scope.resolveInstance(Scope.kt:236)
        at org.koin.core.scope.Scope.access$resolveInstance(Scope.kt:35)
        at org.koin.core.scope.Scope$get$1.invoke(Scope.kt:199)
        at org.koin.core.time.MeasureKt.measureDurationForResult(Measure.kt:74)
        at org.koin.core.scope.Scope.get(Scope.kt:198)
        at org.koin.androidx.viewmodel.factory.DefaultViewModelFactory.create(DefaultViewModelFactory.kt:11)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:187)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:150)
        at org.koin.androidx.viewmodel.ViewModelResolverKt.get(ViewModelResolver.kt:23)
        at org.koin.androidx.viewmodel.ViewModelResolverKt.resolveInstance(ViewModelResolver.kt:12)
        at org.koin.androidx.viewmodel.scope.ScopeExtKt.getViewModel(ScopeExt.kt:86)
        at org.koin.androidx.viewmodel.scope.ScopeExtKt.getViewModel(ScopeExt.kt:72)
        at org.koin.androidx.viewmodel.koin.KoinExtKt.getViewModel(KoinExt.kt:41)
        at org.koin.androidx.viewmodel.ext.android.ActivityExtKt.getViewModel(ActivityExt.kt:71)
        at com.alexnuts.playground.spotify.MainActivity$$special$$inlined$viewModel$2.invoke(ActivityExt.kt:73)
        at com.alexnuts.playground.spotify.MainActivity$$special$$inlined$viewModel$2.invoke(Unknown Source:0)
        at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:81)
        at com.alexnuts.playground.spotify.MainActivity.getVm(Unknown Source:2)
        at com.alexnuts.playground.spotify.MainActivity.onCreate(MainActivity.kt:42)
        at android.app.Activity.performCreate(Activity.java:7825)
        at android.app.Activity.performCreate(Activity.java:7814)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

 

 

Reply

Accepted Solutions
Marked as solution

Okay, let's continue the conversation over e-mail.

(Moderators, you may mark this topic solved if you'd like.)

View solution in original post

4 Replies

Hi there,

 

I'm in the team that works on the Spotify app for Android Automotive.


This is a separate product from the Spotify app for smartphones and the documentation on our public developer portal does not apply to it. We do not support the App Remote SDK and future support is not planned.


We offer this app to car manufacturers and their suppliers in order to integrate it with their infotainment systems. Is the project you are working on is on behalf of a car manufacturer or supplier? If so, we can get in touch to discuss further.

Best regards,
Wilhelm

Hi Wilhelm!
 
Thank you for answer))
 
I’m a part of team that works on app and media sdk for car manufacturers.
So I guess it is better if you will continue the conversation with my manager. 
Ping to my email and I will send manager’s email or just I will share yours 
I've sent an info to you in a private message.
Marked as solution

Okay, let's continue the conversation over e-mail.

(Moderators, you may mark this topic solved if you'd like.)

Hello Wilhelm,

 

I have also a request on this subject. I'm working for car manufacturer and we are working for an application on android, ios and android automotive that use Spotify SDK.

 

Can we exchange over email also ?

 

Best regards,

Michaël

Suggested posts