0

I would make an application that handle the volume buttons when screen is off. The goal would be to turn on or off the front LED.

I know that there many topics here that talk about it, but the recommended solutions (like PARTIAL_WAKE_LOCK) seem to be energy intensive and drain the battery very quickly!

What I want is a solution that is as energy efficient as possible. Is this possible? Maybe some kind of hooking?

Please note that the solutions based on scheduled tasks can not be envisaged for this project because I want detect keys in real time (or close to it)!

1 Answers1

2

Take a look at this question.. if you already haven't ..

Just to make one thing clear. If something is not documented in API docs of android then any hack or workaround you find won't be reliable as Google may decide to change things in future releases, for example there is nothing documented about creating shortcuts after the app is installed ! But Since Android source code is available, developers took that piece of code as how was playstore creating shortcuts.. but its not documented so Google may change it in future !

Community
  • 1
  • 1
Sharp Edge
  • 4,144
  • 2
  • 27
  • 41
  • Thank you! Bad news then, as it does not seem possible to do that _officially_. And you are right to say that it is not advisable to work around with hacks! – Kevin Vuilleumier Jan 14 '15 at 10:24
  • Android has its limitations, I learned this the hard way, wasting much precious time in hacks and then realizing all devices didn't support that(some hack). – Sharp Edge Jan 14 '15 at 10:29