I know HOW to take a screenshot, but I was wondering how it works.
At least since Android 4.0, you have been able to take a screen shot by holding down both the volume-down + power keys on the phone, and Android will capture the current screen and save it to the SD card.
I'm just wondering if anyone knows HOW this works, as in, if it's a service constantly running in the background, or something built into each app, or . Also, where is it located in the source code of Android?
Thanks!
Browsing through the sourcecode i found the section that listens for the key combination and starts the process:
Here's the specific code:
http://androidxref.com/4.1.1/xref/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java#3270
I just found the code in the source tree here: https://github.com/android/platform_frameworks_base/tree/master/packages/SystemUI/src/com/android/systemui/screenshot
I guess it's just a matter of reading through it to get a better understanding of the process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With