I can capture everything on my screen using android MediaProjection api along with MediaRecorder API. When i try to capture for the first time it prompt for permission automatically. I want to take permission manually for Marshmallow. How can i take permission manually ? is it possible?
The link below say that it prompt for permission on createScreenCaptureIntent() method call. I have implemented on my way but need to take permission explicitly before starting my need.
https://commonsware.com/Android/previews/screenshots-and-screen-recordings
While we call
it transfer call to
if
resultcode
is OK andMediaRecorder
,mediaProjecttionManager
andVirtualDisplay
are not null, thhen we can say that we get capturing screen permission otherwise the value ofmediaPorjection
andVirtualDisplay
will be null