Skip to content

Most visited

Recently visited


Media Apps

This section explains how to separate a media player app into a media controller (for the UI) and a media session (for the actual player). It describes two media app architectures: a client/server design that works well for audio apps and a single-activity design for video players. It also shows how to make media apps respond to hardware controls and cooperate with other apps that use the audio output stream.

Media Apps Overview
An introduction to media sessions and media controllers and how they are used in audio and video apps.
Working with a Media Session
A media session hides the details of the code that implements a player/recorder and provides a standard interface for communicating with your UI via media controllers.
Building an Audio App
How to build an audio app using a media browser client activity containing a media controller and a media browser service containing a media session.
Building a Video App
How to build a video app in a single activity with a media session and a media controller.
Responding to Media Buttons
How an app handles events from transport buttons on peripheral hardware.
Handling Changes in Audio Ouput
How to notice when the volume controls change, the headphones are unplugged, and some other apps wants to play audio.
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)