I am working on an application on Android which will share the screen to another android device.This app will run in background as service.
I want to capture the screen (current screen),save it as JPEG and continously send it over UDP to other Android device.
But my problem is how to capture the current screen by capturing framebuffer .
Please help.
The Android framebuffer (and on other linux systems) is accessed by opening the /dev/graphics/fb0 device. This requires root access and even with root access it won't work properly on all devices. Most devices use a pair of framebuffers and toggle between them. The bigger problem is that even with a rooted phone, the Dalvik machine's user ID does not have the privilege to access the frame buffer (fb0) device. This means that you will never be able to open and read from the fb0 device directly from Java code. You will need to run a native linux application as root and it will be able to access fb0 (after the user gives permission). I succeeded in making this work and it is quite challenging and also frowned upon by Google. I still may potentially turn this into a commercial application, but the limitations and incompatibilities put the probability quite low.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With