Screen capture using native APIs?

2019-04-17 11:56发布

问题:

Are there any native APIs (C code) in Ice Cream Sandwich that I can use to capture the entire screen? I need it to be done inside a C program, not using adb or Java interfaces.

回答1:

The androidscreenshot project does exactly that, but you will need to run as root or have your binary signed by the vendor key (i.e. the same key that was used when compiling the OS). There are plenty of discussions about this restriction here and elsewhere on the Internet.