1

I am developing one Application. Through that i want to put the screen in sleep mode for a time period. And my screen will be in dim mode. So when a call will come or sms will come, phone will not blink and notify the user. How it is possible??

Please share any sample code.

Thanks.

Arindam Mukherjee
  • 2,255
  • 11
  • 48
  • 83

1 Answers1

1

Check out PowerManager.goToSleep().

gosr
  • 4,593
  • 9
  • 46
  • 82
  • i checked. But it is throwing exception. What are the permission i have to take?? – Arindam Mukherjee Nov 03 '11 at 12:44
  • It seems your app has to be a "system app" before you can do it. Check out this: http://stackoverflow.com/questions/5710971/android-what-permissions-required-to-call-powermanager-gotosleepn-put-device-i and this: http://stackoverflow.com/questions/5711047/android-how-can-app-run-as-system-app – gosr Nov 03 '11 at 12:49
  • How to make it system app?? I go through those two links, but not getting how to get system key?? – Arindam Mukherjee Nov 03 '11 at 13:02
  • There's a link in the second link I posted, check: http://stackoverflow.com/questions/3598662/how-to-compile-android-application-with-system-permissions. Please read everything carefully and you should get it to work. – gosr Nov 03 '11 at 13:22