article

justin avatar image
justin posted

How can I capture audio / video of my app?   

Summary:

Android.media.projection is a new API included with Android Lollipop. This feature allows applications to capture screen contents and record system audio. Screen capture could be useful for analyzing user interactions with applications, or even offering an instant replay feature in games.

Using the createVirtualDisplay() function begins the capture process and controls various properties of the recording, such as the height and width of the capture area. The state of the projection can be monitored through a callback. The recording can be stopped simply calling stop(). The screen can be recorded without audio by using the createScreenCaptureIntent().

For more information, see the official Android documentation here: https://developer.android.com/reference/android/media/projection/MediaProjection.html

Keywords: screen capture, recording, device capture, instant replay

KB_0110

androidlollipop
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Article

Contributors

brizzlebrazzle contributed to this article Justin@Amazon contributed to this article