Implementation of screenshot capture in Android system (with code included) and screenshot capture in android system
1. I have been writing a blog on the background for almost two years. I have written more than 100 articles. The most popular article is how to achieve screenshots of the android system. In fact, google android_screen_shot will find the right method, but those are all years ago. After android4. *, android corrected the source code so that the previous methods could not be used. Thanks to cjd6568358, we discussed it together and finally implemented the screenshot function of the android system. In order to make the coder that wants this function less detours, we organized the code into an open-source project.
2. Ideas
In fact, the main idea is as mentioned in my blog post. If you are interested, you can check it out. [Android4.3] recording a complete screenshot capture of the android source code (different from the old version on the Internet) test and failure analysis of the screenshot function of android4.3 perform system screenshot (no portability at present) in the operating source code of android 4.3 and later versions of Android4.0 Background service Cross-process screenshot current screen Summary (reference from cjd6568358)
3. you can use this method to easily access open-source projects. Download the jar file and import it to your own project. Call the function name: takeScreenshot (Context context, String fileFullPath). If the complete file path is empty, the method automatically creates a file name at the current time and stores it in the/data/local/tmp folder.
Project address: star after use. Thank you!
/********************************
* This article is from the blog "Li bogarvin"
* Reprinted please indicate the source: http://blog.csdn.net/buptgshengod
**************************************** **/
How to use the code in android to implement screenshots
Blog.csdn.net/..520403
Hope to help you!
Can screenshots of android code be implemented? How can this problem be achieved? Help Ang
You can directly use FrameBuffer: In/dev/graphics, fb0 ~ Fb4: This is frame buffering. The specific format is unknown. You can analyze it.
Alternatively, if your interface is a normal interface, you can directly create a Bitmap and Canvas, and use View. draw to draw it.