How to use MediaSessionCompat and maintain backward compatibility with RemoteControlClient?

I want to replace the android RemoteControlClient class in my application with a new one using MediaSession, but it doesn’t work with API level <21, MediaSessionCompat seems to work without crashes of old devices, but no more ARTWORK info or songs on LockScreen ...

Any piece or info for me?

Thanks everyone!

+8
android
source share
1 answer

Starting with version 22 of the Support-v4 library, the source code for MediaSessionCompat shows that it will now automatically register and use the RemoteControlClient in API devices 14-20 before switching to MediaSession on API21 + devices.

+11
source share

All Articles