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 the rabbit-loving Tom radish, 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, the code we compiled is made into an open-source project. 2. The main idea is what I mentioned in my blog post. If you are interested, read it. [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 the moment) in the operating source code of android 4.3 and later versions of Android4.0 and Background service Cross-process screenshot of current screen summary (reference the rabbit-loving radish)
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!
Discuss with the author and follow the Public Account "Mortal machine learning"