How can I remotely screen-share an Android device without showing the screen-sharing permission popup every time?


I am developing an Android application that needs to remotely view/stream the device screen.

Currently, I use Android’s MediaProjection API for screen capture. However, Android shows the screen-capture permission dialog every time I start the screen-sharing process.

Is there a way to start screen sharing remotely without showing the MediaProjection permission dialog every time?

The device is running on android 14
The application is third party app written on kotlin

What is the recommended way to implement this?

-1
Sep 22 at 12:23 AM
User AvatarMunkhjargal Nymsuren
#android#kotlin#devops

Accepted Answer

You cant on newer versions of android, any time you want to capture the screen you must call createScreenCaptureIntent to get a new permission intent each time you can no longer hold the onto that intent.

This is for obvious security reasons.

You would only be able to not show the dialog if the device was rooted

User Avatartyczj
Sep 22 at 12:15 PM
2