Search code examples
androidpermissionsscreen-recording

Can an app access screen of another app in android?


I would like my app to scan text that another app renders on the screen, for example scan subtitles. Is that possible in Android?


Solution

  • Yes, you can capture the screen using the MediaProjection APIs. Request permission via MediaProjectionManager.createScreenCaptureIntent() and then use the resulting MediaProjection object to render the screen to a Surface.

    Note that for subtitles specifically, you may be unable to see them if the app displaying them is showing DRM-protected content.