Re: [android-developers] [Monkeyrunner]: How to simulate short press on power button

2011-03-07 Thread Bill Napier
Hi, I tested this on Nexus S and it worked in the way I expected. If I specify DOWN_AND_UP, the screen locks and goes to sleep. If I specify just DOWN, I get the Phone options. I tried with the emulator and saw the same behavior you saw, I'm not sure why. Let me try and borrow an Xperia from

Re: [android-developers] [Monkeyrunner]: How to simulate short press on power button

2011-03-07 Thread aniruddha dhamal
Hi, I tried with Nexus S also [DOWN_AND_UP], but it didn't work ( behaviour: nothing happens). It might have locked the screen in your case because Display time (in Settings) was 15 sec (that's what happened with me initially but after changing that to 30 minutes it didn't work). I thought

Re: [android-developers] [Monkeyrunner]: How to simulate short press on power button

2011-03-03 Thread Bill Napier
This worked for me. It turned off my Nexus S when I tried it. What you were doing was only sending the down part of the DOWN_AND_UP, so it was like you were pressing the POWER button and then never ever taking your finger off of it. If you want even more control over the duration of the press,

Re: [android-developers] [Monkeyrunner]: How to simulate short press on power button

2011-03-03 Thread aniruddha dhamal
Thanks Bill, But this code for short press on POWER button isn't working. I tried with emulator (Android 1.6, Android 2.1) and also on Xperia device. I also tried with controlling duration of the press but it opens the Phone Options. I wanted to simulate lock screen by pressing on POWER Button.

Re: [android-developers] [Monkeyrunner]: How to simulate short press on power button

2011-02-28 Thread aniruddha dhamal
I tried to use *device.press('KEYCODE_POWER', 'down')* but this works for long press on power button. Thanks, On Sat, Feb 26, 2011 at 4:01 PM, Andya ani123.dha...@gmail.com wrote: Hello guys, Any help on how to simulate short key press on Power button using MonkeyRunner? I am using the

[android-developers] [Monkeyrunner]: How to simulate short press on power button

2011-02-26 Thread aniruddha dhamal
Hello guys, Any help on how to simulate short key press on Power button using MonkeyRunner? I am using the following code but to no avail device.press('KEYCODE_POWER','DOWN') Really appreciate!!! -- You received this message because you are subscribed to the Google Groups Android Developers

[android-developers] [Monkeyrunner]: How to simulate short press on power button

2011-02-26 Thread Andya
Hello guys, Any help on how to simulate short key press on Power button using MonkeyRunner? I am using the following code but to no avail device.press('KEYCODE_POWER','DOWN') Really appreciate!!! -- You received this message because you are subscribed to the Google Groups Android Developers