How to determine screen color depth in android

1.3k views Asked by At

I'm trying open and read '/dev/graphics/fb0' to determine screen color depth, but it returns error Permission denied.

Do you have any idea how to determine color depth of device?

1

There are 1 answers

0
Anil Meenugu On BEST ANSWER

Since the fb0 is a buffer file, it is an always-changing file, you should copy it to a certain ACCESSIBLE destination then read it with FileInputStream,

Like:

("cat /dev/graphics/fb0 > /dev/myRawFrame.raw");

File CurrentRawFile = new File("/dev/myRawFrame.raw");

Determine screen color depth in android