简体   繁体   中英

Screen shot in android from a background app

I undestood that I can't print screen another app from my app in the background due to a security reasons but there are apps that do so like apps that record the screen. For example "DU Recorder". So how do they are doung it in the code?

For Lollipop and above you can use the MediaProjection API of Google to take the screenshot but you need to ask for the permission from the user.

You can find the sample screen capture code using MediaProjection Here

For the devices less then Lollipop you need root permission for it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM