Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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 has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

1 Answer

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 android.stackexchange.com/questions/9826/… 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
1  
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. –  sam Feb 2 '12 at 19:35
add comment

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