I can use ioctl() to access the framebuffer (whose device file is
/dev/graphics/fb0 in android).
Maybe you can describe your steps in detail.
Peter
>
> -thanks in advance
> --
> You received this message because you are subscribed to the Google
> Groups "android-ndk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-ndk/-/XnOcp4a0bWAJ.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-ndk...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-ndk?hl=en.
I tried to use ioctl on the framebuffer to access it, but i got the error "not a typewriter" ..Any help
-thanks in advance
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/XnOcp4a0bWAJ.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
http://www.pocketmagic.net/?p=1473
Another showing direct access via commandline:
http://my.opera.com/otaku_2r/blog/grab-a-frame-in-android-frame-buffer
And according to this:
http://code.google.com/p/android-x86/issues/detail?id=75
your "not a typerwriter" issue may be related to:
a. Not using "root" on the Android device. (rooted device needed).
b. QEMU emulator problem. Try using the direct device?
c. Driver related problem? Eg, see this for similar error:
http://acassis.wordpress.com/2010/03/31/debugging-keypad-on-android/
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-ndk/-/XnOcp4a0bWAJ.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-ndk...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-ndk?hl=en.
>
--
Regards,
Peter Teoh
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-ndk/-/IN8GkTkcm7QJ.
java.lang.Process sh = Runtime.getRuntime().exec("su -c sh");
OutputStream os = sh.getOutputStream();
then pass in all your commands to the process output stream. this
will run them as root. You could probably make it one line and
replace 'sh' with whatever your process name is, but I'm just
cutting/pasting right now.
Just because your phone is rooted, it doesn't mean that everything
automatically runs as root. You need to force it.
As a consequence, you can't use JNI, or at least I'm not sure how you
would. You'll also need to set up the make file to produce an
executable rather than a library file. If you figure out a way to do
JNI, please let me know. We just released a video recording product
for rooted phones, but we have another non-rooted jni version in the
making, baked into apps, and I wouldn't mind bringing the code bases
closer together.
http://touchtrack.co/home.seam
Sorry for the shameless plug ;)
-Kevin
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-ndk/-/MLIx_dsjD4wJ.
The emulator is a weird situation. If you adb shell into it, you have
more access than you normally would on a regular device. However,
your apps don't have access. Normally, if you did adb shell into a
non-rooted device, you wouldn't be able to read fb0 there either.
That's why on the emulator you could copy from /dev/graphics to the
sdcard. Otherwise you probably wouldn't be able to.
Just FYI, the file you copied into /mnt/sdcard/fb0 is raw pixel data.
Its a WxH array, probably 32 bit. You can read it in like that.
Now, if you want access from your app, you *may* be able to try my
method, but without the 'su -c' part. Just the 'sh', then try copying
the fb0 file from /dev/graphics to /mnt/sdcard. I've had some success
with that on the emulator.
I hate it when people do this, but I have to ask. Why are you trying
to do this?
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-ndk/-/M-4eNPzdBtIJ.
yes I was trying to run ioctl on the file /mnt/sdcard/fb0 and that wasnt working ..thanx for telling the reason as to why it wasnt working :) ... So is there any way that my c code can open /dev/graphics/fb0 on the emulator with sufficient permissions to open the /dev/graphics/fb0 (basically I am trying to write a code for taking a screenshot programmatically ..I dont want to use any apps for that :P)
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/2NXLR31vrJsJ.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Why does Google provide such an error message?
For certain applications especially if low latency is the goal there should be a way to access the framebuffer.This error message should read: I see what you are doing there, and we are going to make it available soon.
Am Freitag, 10. Juni 2011 10:28:32 UTC+2 schrieb Rohit:I tried to use ioctl on the framebuffer to access it, but i got the error "not a typewriter" ..Any help
-thanks in advance
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk?hl=en.For more options, visit https://groups.google.com/groups/opt_out.