Re: [android-developers] How to manually dispatch key event for power button in android

2012-01-20 Thread Kristopher Micinski
Additionally, it's not even possible to "lock" the phone at all, by
code, in any ways that can't be easily defeated and are essentially
nothing more than parlor tricks.

kris

On Fri, Jan 20, 2012 at 8:21 AM, Mark Murphy  wrote:
> On Fri, Jan 20, 2012 at 1:42 AM, ashiq sayyad  wrote:
>> I have an implementation to lock the phone .I checked the device admin
>> API.It is introduced after 2.1.So to have lock functionality for all
>> versions devices,I am planning to dispatch power button event through code.
>
> Fortunately, this is not possible.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android 4.0 Programming Books: http://commonsware.com/books
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] How to manually dispatch key event for power button in android

2012-01-20 Thread Mark Murphy
On Fri, Jan 20, 2012 at 1:42 AM, ashiq sayyad  wrote:
> I have an implementation to lock the phone .I checked the device admin
> API.It is introduced after 2.1.So to have lock functionality for all
> versions devices,I am planning to dispatch power button event through code.

Fortunately, this is not possible.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 4.0 Programming Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] How to manually dispatch key event for power button in android

2012-01-19 Thread ashiq sayyad
I have an implementation to lock the phone .I checked the device admin
API.It is introduced after 2.1.So to have lock functionality for all
versions devices,I am planning to dispatch power button event through code.

If is there any other way to lock the phone via code ,please let me know...

Thanks & Regards,
Ashiq Sayyad

On 20 January 2012 02:37, Kristopher Micinski wrote:

> Why are you trying to do this anyway?
>
> kris
>
> On Thu, Jan 19, 2012 at 3:56 PM, Mark Murphy 
> wrote:
> > This would do you no good. Not only can't you attack the device by
> > simulating a power button press, but you cannot respond to power
> > button events.
> >
> > On Wed, Jan 18, 2012 at 7:11 AM, ashiq sayyad 
> wrote:
> >> Hi,
> >>
> >> I want to dispatch key event for Power button programatically.I tried
> >> following line of code but its not working..
> >>
> >>  dispatchKeyEvent(new
> >> KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_POWER));
> >>
> >> But this is not working..
> >>
> >> Any help on this most welcome..
> >>
> >> Thanks & Regards,
> >> Ashiq  Sayyad
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Android Developers" group.
> >> To post to this group, send email to
> android-developers@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> android-developers+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/android-developers?hl=en
> >
> >
> >
> > --
> > Mark Murphy (a Commons Guy)
> > http://commonsware.com | http://github.com/commonsguy
> > http://commonsware.com/blog | http://twitter.com/commonsguy
> >
> > Warescription: Three Android Books, Plus Updates, One Low Price!
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] How to manually dispatch key event for power button in android

2012-01-19 Thread Kristopher Micinski
Why are you trying to do this anyway?

kris

On Thu, Jan 19, 2012 at 3:56 PM, Mark Murphy  wrote:
> This would do you no good. Not only can't you attack the device by
> simulating a power button press, but you cannot respond to power
> button events.
>
> On Wed, Jan 18, 2012 at 7:11 AM, ashiq sayyad  wrote:
>> Hi,
>>
>> I want to dispatch key event for Power button programatically.I tried
>> following line of code but its not working..
>>
>>  dispatchKeyEvent(new
>> KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_POWER));
>>
>> But this is not working..
>>
>> Any help on this most welcome..
>>
>> Thanks & Regards,
>> Ashiq  Sayyad
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] How to manually dispatch key event for power button in android

2012-01-19 Thread Mark Murphy
This would do you no good. Not only can't you attack the device by
simulating a power button press, but you cannot respond to power
button events.

On Wed, Jan 18, 2012 at 7:11 AM, ashiq sayyad  wrote:
> Hi,
>
> I want to dispatch key event for Power button programatically.I tried
> following line of code but its not working..
>
>  dispatchKeyEvent(new
> KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_POWER));
>
> But this is not working..
>
> Any help on this most welcome..
>
> Thanks & Regards,
> Ashiq  Sayyad
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] How to manually dispatch key event for power button in android

2012-01-19 Thread ashiq sayyad
Hi,

I want to dispatch key event for Power button programatically.I tried
following line of code but its not working..

  dispatchKeyEvent(new
KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_POWER));

But this is not working..

Any help on this most welcome..

Thanks & Regards,
Ashiq  Sayyad

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en