I’d like to take screenshots on my android phone. I’m an app developer and have a pretty good understanding of the regular API, and I know this steps out of the “regular” thing quite a bit.
I would have root access.
I’ve seen a few apps that do this. I’m just wondering how one goes about doing it. Anybody know the general direction I should be looking in?
Have a look at framebuffer.c in the adb (phone side) sources, which appears to be what the DDMS screenshot capability uses. You need to be uid root or gid graphics due to the permissions on the framebuffer device – presumably the adbd is the later.
It is in
/platform/system/core:Direct link to the file:
https://android.googlesource.com/platform/system/core/+/gingerbread-release/adb/framebuffer_service.c