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