Detailed explanation and example code of Android sneak shooting function (taking photos when the mobile phone is turned off)
Android candid function / phone can take photos when turned off
The effects are as follows:
In fact, the implementation method of sneak shooting and sneak recording is the same. They all use the principle of WindowManager to draw desktop widgets. Then I won't say more
1、 First, we need a surfaceview:
2、 Then the operation is to produce this widget:
3、 The desktop controls are available. Of course, the following is to add them to the desktop using WindowManager:
4、 At this time, we need the surfaceview. Then, how can we operate in the background? Naturally thought of service
Perform the operation of desktop control in service:
5、 Bind the service in the activity to take photos
6、 Control the start and end of photographing in mywindowmanager in service
7、 Start or stop photographing in myphotowindowmanager
8、 Take photos in inittimetotakepic
Demo download address: http://www.jb51.net/softs/519032.html
Thank you for reading, hope to help you, thank you for your support to this site!