Implementation of screenshots for Android system (code attached)

Source: Internet
Author: User
Tags tmp folder

1. BackgroundWrite a blog Almost two years, wrote a 100+ article, the most popular article is also the most concern is how to achieve the Android system screenshot. In fact, we Google Android_screen_shot will find the right way, but those are many years ago, in the android4.* version, Android for the source code has been corrected, so that the previous methods can not be used. thank cjd6568358 This netizen, we discuss together, finally by he realizes the Android system screenshot function, in order to let later want this function of coder can take a few detours, we organize the code into open source project. 2. IdeasIn fact, the main idea or before my blog post mentioned that we are interested to see. "android4.3" a complete capture of the Android source screenshot event (different from the old version on the Internet) the attempt and failure analysis of android4.3 screenshot function Android 4.3 operating source Implementation System screenshot (no portability)Android4.0 above version background service intercepts the current screen summary across processes (referenced from cjd6568358)3. How to use    The use of the method is also very convenient, enter the open source project, download the jar file to import your own project, call the function name: Takescreenshot (Context context, String Filefullpath) If the file full path is empty, the method will be the current time Automatically create file names and save them under the/data/local/tmp folderProject address: Please star after use, thank you!

/********************************

* This article from the blog "Bo Li Garvin"

* Reprint please indicate source : Http://blog.csdn.net/buptgshengod

******************************************/

Implementation of screenshots for Android system (code attached)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.