Media Playback with MediaSessionCompat (Android Development Patterns Ep 4)



Media Playback with MediaSessionCompat (Android Development Patterns Ep 4)

Media Playback with MediaSessionCompat (Android Development Patterns Ep 4)

MediaSessionCompat integrates your Android media app into the system, bringing media metadata and standardized controls on notifications, Android Wear, and the lock screen.

With the help of a Media Button Receiver (http://developer.android.com/training/managing-audio/volume-playback.html#PlaybackControls), your app will handle media buttons from bluetooth headsets and Android Wear devices with a single API for all Android 2.0+ devices.

For Android 4.0-4.4, you’ll no longer need to write deprecated RemoteControlClient code to get lock screen media controls as MediaSessionCompat will automatically wrap the API on those platform versions while giving you the best experience on Android 5.0+ devices.

You’ll also find that MediaSessionCompat works well with NotificationCompat.MediaStyle (https://developer.android.com/reference/android/support/v7/app/NotificationCompat.MediaStyle.html) for the best media notifications across all API7+ devices.

#media #wearables #wear