0

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.

Darshan Rivka Whittle
  • 32,989
  • 7
  • 91
  • 109
vakor
  • 15
  • 1
  • 3

1 Answers1

0

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.

Rupert Rawnsley
  • 2,622
  • 1
  • 29
  • 40
  • Thanks. It does take the screenshot,but it stores image in .raw format. Do you know how to convert .raw to .png or .jpeg using android native interface? – vakor Jun 05 '12 at 20:07
  • 1
    screencap is a binary that appears to ship as part of the ICS framework. It reads the frame buffer and optionally converts to PNG using something called SkImageEncoder. The source is here: https://github.com/android/platform_frameworks_base/blob/master/cmds/screencap/screencap.cpp – Rupert Rawnsley Jun 07 '12 at 21:34