0

I was looking for but I can not find what I need. I want to receive an SMS lights from turning on my keyboard touch .. I know to know when an sms arrives BroadcastReceiver joins the class .. but someone knows how to do to activate the backlight of the keyboard? Thanks in advance

Gonzalo GM
  • 99
  • 7
  • What do you mean by the backlight of the keyboard? Are you talking about a specific phone model? Most phones use on-screen keyboards – StephenG Jul 22 '15 at 22:06
  • You mean backlit touch buttons (menu,back) if available on device like Samsung? Still you have to see that many phones like Nexus and Sony do not have such buttons. And further receiving a notification, android OS automatically glows those buttons to best of my knowledge. You approach can only make sense if you are not throwing a notification and want to forcefully turn up the backlit which is not so required or may looks weird as being normal user I start to look for notification or message if any pops up. I recommend you to leave this on OS. –  Jul 22 '15 at 23:18

1 Answers1

0

The most correct answer is that this is not possible in a portable way (that works on every Android device). This is because the Android SDK does not define a standard way to control the keyboard backlighting system.

There are several answers though that exist such as this one which explains that it is possible to interact with the backlighting system using the sysfs, on some device. This appears to be done by interacting with the hardware by writing a value to a specific pseudo file, as follow :

echo 0 > /system/class/leds/keyboard-backlight/brightness

To do so, your application must have root privileges which requires your phone to be rooted. Also note that even if your phone is rooted, the above pseudo-file might not be available on every device having a backlighting system.

Community
  • 1
  • 1
Halim Qarroum
  • 13,985
  • 4
  • 46
  • 71
  • thank you all for answering, @Halim Qarroum you tell me how to apply that code you gave me? I followed the path and found the brightness file, then change its value by 1, but is automatically returned to 0. will I need special permission to write to system files? . Thank you for your attention – Gonzalo GM Jul 24 '15 at 13:55
  • The required permissions depends on the implementation. What are the permissions currently associated with this file on your device ? – Halim Qarroum Jul 24 '15 at 14:26