EZ Screenshot is using the API of "Cast screen" built in Android 5.0.
You can start a screenshotting with following ways:
• Overlay window.
• Click the "DO IT" button in the notification bar tool.
• Shake your device.
For now only Android 5.0 and higher devices are supported.
Source code: https://github.com/zty5678/EZScreenshot