I'm trying to use MediaProjection API
https://developer.android.com/reference/android/media/projection/MediaProjection.html
To Save Data To a series of pictures.
All that i could find on the web was guides that use a Surface, and they cast the MediaProjection to a surface.
All the guides i could find started an intent for the result
startActivityForResult(
mMediaProjectionManager.createScreenCaptureIntent(),
REQUEST_MEDIA_PROJECTION);
and then just mirrored the MediaProjection Data to a surface
mVirtualDisplay = mMediaProjection.createVirtualDisplay("ScreenCapture",
mSurfaceView.getWidth(), mSurfaceView.getHeight(), mScreenDensity,
DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR,
mSurface, null, null);
Is there a way i can mirror the screen directly to an Image file and then save the Image file periodically ?
Or a different way to save the data form the MediaProjection object directly to images instead of showing it on screen ?