0

I'm trying to open Spotify on Android Auto and reproduce a specific song.

Using the code below I'm opening Spotify on the phone, but I need to open it on the Car directly.

final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("spotify:track:" + spotifyId));
  intent.setPackage("com.spotify.music");
  intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  context.startActivity(intent);

Does anybody know what's the Intent to open Spotify on Android Auto?

1 Answers1

0

Android Auto and native Android are 2 separate platforms. The idea of activities isn't exactly the same in Auto, and interacting with other apps and activities directly isn't available without the complete SDK, which isn’t publicly available. The current Auto public templates for messaging and media don't have the support to start car activities for other apps.

Apps that work with Auto run on a connected device, and communicate to a compatible dashboard through specific APIs. This communication is handled via the Android Auto app, which projects a user interface to the dashboard for the connected app that is designed for use in a car.

salminnella
  • 744
  • 2
  • 6
  • 17