androidwear-osgoogle-music

Get current track info and media controls


In Android Wear Google play music seems to integrate somehow generic music controls, in Android 5 lollipop this can be done using MediaSession, however in pre Lollipop you can't. You can use MedicaControllerCompat but seems this does not work, do nothing on pre Lollipop. So how can i make a Music Media contoller? Android wear (or Google music mini) can skip next or prev track from spotify for example)


Solution

  • The RemoteController was the older equivalent to the new MediaController API, but was only made public in Android 4.4 (Kitkat) and has a number of onerous requirements for non-system apps (such as being an enabled NotificationListenerService), hence why it is now deprecated along with the older RemoteControlClient API that apps like Spotify use.

    TL/DR: non-public before Android 4.4, public but hard to use on Android 4.4, and the totally new API on Android 5.