Android Media samples
A selection of code samples for you to use to accelerate your app development. Browse samples to learn how to build different components for your apps.
Highlighted samples
Universal Android Music Player
This sample shows how to implement an audio playback app using Media3 ExoPlayer that works across multiple form factors and provides a consistent user experience.
Media3 Transformer
This sample shows how to use the Media3 Transformer APIs to create a media editing app.
Test & validation
Media Controller Test app
A sample implementation of the MediaController API that you can use to test the intricacies of media playback on Android and to verify your media session implementation.
API Demos
Media3 Main Demo
A simple playback app that uses ExoPlayer to play a number of test streams. A good starting point or reference project.
Media3 Session Demo
A playback app that implements a MediaSession.
Media3 Cast Demo
A playback app with Google Cast integration. Demonstrates switching between Cast playback and local playback.
Media3 SurfaceControl Demo
A playback app that uses the SurfaceControl API to redirect ExoPlayer’s video output to different views. Requires minSdkVersion 29.
Media3 GL Demo
A playback app that renders video to a GLSurfaceView and applies a GL shader.
MIDI Samples
This collection of sample apps showcases MIDI 2.0 APIs introduced in Android 13.