I noticed that in the native code, the way they capture the
framebuffer data is by calling "int fb = open("/dev/graphics/fb0",
O_RDONLY);"

I tried to do that with Java, by calling "File f = new File("/dev/
graphics/fb0");" but I get a "file not found" exception.

Any idea why?




On Aug 4, 11:58 pm, Kaj Bjurman <[email protected]> wrote:
> I tried this a few days ago, and couldn't find a way to do it in pure
> Java. There can of course still be a way to do it, but it does also
> look like screenshot apps are using native code as part of their
> implementation.
>
> I'm still pretty new on Android development, but I don't think that
> the real phone is listening on a socket under normal circumstances. It
> will listen on the USB channel. I think I've seen a post that said
> something being able to use ethernet over USB, but I can't remember
> where, and I don't know if it helps.
>
> On 4 Aug, 21:11, NTDYLF <[email protected]> wrote:
>
>
>
> > Hello all y'all. How can I take a screenshot programmatically? So far
> > I've learned that:
>
> > 1) DDMS does it by sending "framebuffer:" to the adb service over a
> > socket, which takes a screenshot in framebuffer_service.c that it
> > sends back.
> > 2) There are some proprietary screenshot apps out there that stipulate
> > the user must have root access, I'm not sure why.
>
> > Would it be possible for an Android app to send "framebuffer:" to its
> > own adb service and get the screenshot that way?
>
> > Thanks in advance.
>
> > ntdylf
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to