1

I am developing an sensor based app to unlock & lock device using sensors. I am able to lock the device using Device Administrator API.

But, Unfortunately I am unable to find any code to unlock the screen programmatically. I have searched over Google & other Android Development sites too. Then, too I didn't find any solution.

Tried several tricks like wakelock but it doesn't work for some devices & eats battery Then, I tried KeyguardManager but it removes the lockscreen but not does not unlock the device

I am trying to use Receiver for receive screen on/off events but I don't know how to make it

Hope, Any one can help me

I already had thorough search but no hopes

Thanks in advance.

Simon
  • 14,407
  • 8
  • 46
  • 61
Akshay Chordiya
  • 4,761
  • 3
  • 40
  • 52

1 Answers1

1

I think this post will resolve your problem. You need to make use of PowerManager.

Community
  • 1
  • 1
Raja Asthana
  • 2,080
  • 2
  • 19
  • 35
  • Use Handler & send empty delayed message method. For Samsung ROMS set the Timeout of WAKELOCK.AQUIRE(LONG>0) For other AOSP ROMS set the WAKELOCK.AQUIRE(0) – Akshay Chordiya May 30 '13 at 18:46