Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Is there any android widget which allows me to lock my phone? The 'power' button on my android phone is broken? I can't use that to lock my phone screen.

Thank you.

share|improve this question

marked as duplicate by Izzy, Al E., roxan, t0mm13b, Liam W Mar 23 '13 at 21:53

This question was marked as an exact duplicate of an existing question.

up vote 0 down vote accepted

Short answer is no.

[Extended Answer]
This would require the use of PowerManager.gotoSleep(long time), and the use of that method requires the android.permission.DEVICE_POWER permission. DEVICE_POWER is only available to applications signed as system applications. Only applications that ship with the device and signed by the manufacture would be allowed to use the method.

share|improve this answer
I read… and I am able to find and install a Lock Screen Widget. Why a Widget can do that despite what you said? – michael Jun 2 '11 at 22:12
a "lock screen widget" does not actually lock the device. the lock screen cannot be replaced (currently) in android. These applications attempt to override the lock screens. they are nothing more then applications that have no title bar. I have yet to find one that works without any lag when turning the device back on. If you feel that that these fit your needs, then great, but they do not actually lock the device. – Ryan Conrad Jun 3 '11 at 13:46
@RyanConrad +1. You are right. I have tested such widget apps and they do lag. So its better not to have such wdgets. – VVK Feb 2 '12 at 19:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.