1

is it possible to make an screenshot of another app from background and convert it to Bitmap to make some changes before save? device is rooted.

i've tried perform console command but it automatically saves file to disk, so i need than read file, make changes (show to user) and save it again (or remove). so, want to avoid first saving.

btw, is it possible to screen only specific area, not full screen?

Siarhei
  • 2,358
  • 3
  • 27
  • 63

3 Answers3

2

If you can make a system app (a app that is signed with the same key as your Android System) then you can use a WindowManagerService.java API screenshotApplications() which returns a Bitmap of the screenshot.

For more details please go through WindowManagerService.java source

Apoorv Parmar
  • 274
  • 4
  • 9
2

One more solution found that works on non rooted devices with 21+ API is to use MediaProjectionManager.

Here example how to use it and here how to manage from service

Community
  • 1
  • 1
Siarhei
  • 2,358
  • 3
  • 27
  • 63
1
 No , you need to save the file before any processing is needed to be done on the image before. 
You can one thing is let the file be saved and then with proper permissions you can overwrite the file by :
1. creating a copy
2.making changes
3.deleting the original
4.renaming the changed file
learner66666666
  • 167
  • 1
  • 1
  • 15