[android-developers] Re: hooking to the PHONE button

2008-11-06 Thread Declan Shanaghy
Now you're just arguing semantics.
I never said he could steal it, that would be quite a stupid thing for the
OS to allow.

Registering for that Intent allows him to do what he wants in the context of
when he is allowed to do it.
Therefore it answers his question (or at least gets him as close as he is
ever going to get)



On Wed, Nov 5, 2008 at 11:09 AM, hackbod [EMAIL PROTECTED] wrote:


 It's not the same, you can't steal it from everyone.  This only
 happens when the currently focused app doesn't do anything special
 with the phone key.  The home key, in contrast, can not be handled by
 the foreground app -- it always starts the home activity.

 On Nov 5, 10:09 am, Declan Shanaghy [EMAIL PROTECTED] wrote:
  Well that would imply that the default handling is setup they way i
  suggested it should be!  ;-P
 
  @simonsh
  There's your answer!
 
  On Tue, Nov 4, 2008 at 6:09 PM, hackbod [EMAIL PROTECTED] wrote:
 
   Oh the -default- handling of the green key is this:
 
  private void startCallActivity() {
  Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  getContext().startActivity(intent);
  }
 
   So you can write an activity that implements that action.  You can -
   not- however generally intercept the green key: if the app handles it
   yourself (such as pressing the green key while highlighting a phone
   number to place a call) you won't run.
 
   On Nov 4, 4:23 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
It doesn't seem that way.
No matter what application I am in if I press the green phone button
 the
recent call log comes up.
 
What about when the user is on the home screen?
 
On Tue, Nov 4, 2008 at 12:22 AM, hackbod [EMAIL PROTECTED] wrote:
 
 The green phone key is for use by the foreground application.
 
 On Nov 3, 7:34 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
  It shouldnt be stolen but it should be overridable.
  Much like the app picker behaves when multiple apps are
 registered
   for an
  Intent.
 
  I dont know how the internals of how the off hook button works
 but
 couldnt
  it broadcast an Intent to go off hook which then can be handled
   like
 any
  other intent. To avoid the annoying situation of having to choose
 an
   app
  every time a changeable default could be setup.
  (Like how RingDroid replaces the default ringtone picker)
 
  On Mon, Nov 3, 2008 at 3:15 PM, hackbod [EMAIL PROTECTED]
 wrote:
 
   Correct, you can't steal it from other apps.  When your apps is
 in
   the
   foreground, however, you will see the key as a normal key event
   that
   you can process however you want.
 
   On Nov 3, 1:11 pm, Shawn [EMAIL PROTECTED] wrote:
I don't think you would be allowed to remap the phone button
 that
 would
   force people to use your app even if they didn't want to and my
 be
   considered malacious. That's just an opinion though
 
-Original Message-
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
 
Date: Mon, 3 Nov 2008 13:09:53
To: Android Developersandroid-developers@googlegroups.com
Subject: [android-developers] hooking to the PHONE button
 
Hi,
 
How can I make my own application run whenever the user
 presses
   the
green PHONE button ?
 
TIA
 


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: hooking to the PHONE button

2008-11-05 Thread Declan Shanaghy
Well that would imply that the default handling is setup they way i
suggested it should be!  ;-P

@simonsh
There's your answer!



On Tue, Nov 4, 2008 at 6:09 PM, hackbod [EMAIL PROTECTED] wrote:


 Oh the -default- handling of the green key is this:

private void startCallActivity() {
Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(intent);
}


 So you can write an activity that implements that action.  You can -
 not- however generally intercept the green key: if the app handles it
 yourself (such as pressing the green key while highlighting a phone
 number to place a call) you won't run.

 On Nov 4, 4:23 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
  It doesn't seem that way.
  No matter what application I am in if I press the green phone button the
  recent call log comes up.
 
  What about when the user is on the home screen?
 
  On Tue, Nov 4, 2008 at 12:22 AM, hackbod [EMAIL PROTECTED] wrote:
 
   The green phone key is for use by the foreground application.
 
   On Nov 3, 7:34 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
It shouldnt be stolen but it should be overridable.
Much like the app picker behaves when multiple apps are registered
 for an
Intent.
 
I dont know how the internals of how the off hook button works but
   couldnt
it broadcast an Intent to go off hook which then can be handled
 like
   any
other intent. To avoid the annoying situation of having to choose an
 app
every time a changeable default could be setup.
(Like how RingDroid replaces the default ringtone picker)
 
On Mon, Nov 3, 2008 at 3:15 PM, hackbod [EMAIL PROTECTED] wrote:
 
 Correct, you can't steal it from other apps.  When your apps is in
 the
 foreground, however, you will see the key as a normal key event
 that
 you can process however you want.
 
 On Nov 3, 1:11 pm, Shawn [EMAIL PROTECTED] wrote:
  I don't think you would be allowed to remap the phone button that
   would
 force people to use your app even if they didn't want to and my be
 considered malacious. That's just an opinion though
 
  -Original Message-
  From: [EMAIL PROTECTED] [EMAIL PROTECTED]
 
  Date: Mon, 3 Nov 2008 13:09:53
  To: Android Developersandroid-developers@googlegroups.com
  Subject: [android-developers] hooking to the PHONE button
 
  Hi,
 
  How can I make my own application run whenever the user presses
 the
  green PHONE button ?
 
  TIA
 


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: hooking to the PHONE button

2008-11-05 Thread hackbod

It's not the same, you can't steal it from everyone.  This only
happens when the currently focused app doesn't do anything special
with the phone key.  The home key, in contrast, can not be handled by
the foreground app -- it always starts the home activity.

On Nov 5, 10:09 am, Declan Shanaghy [EMAIL PROTECTED] wrote:
 Well that would imply that the default handling is setup they way i
 suggested it should be!  ;-P

 @simonsh
 There's your answer!

 On Tue, Nov 4, 2008 at 6:09 PM, hackbod [EMAIL PROTECTED] wrote:

  Oh the -default- handling of the green key is this:

     private void startCallActivity() {
         Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         getContext().startActivity(intent);
     }

  So you can write an activity that implements that action.  You can -
  not- however generally intercept the green key: if the app handles it
  yourself (such as pressing the green key while highlighting a phone
  number to place a call) you won't run.

  On Nov 4, 4:23 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
   It doesn't seem that way.
   No matter what application I am in if I press the green phone button the
   recent call log comes up.

   What about when the user is on the home screen?

   On Tue, Nov 4, 2008 at 12:22 AM, hackbod [EMAIL PROTECTED] wrote:

The green phone key is for use by the foreground application.

On Nov 3, 7:34 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
 It shouldnt be stolen but it should be overridable.
 Much like the app picker behaves when multiple apps are registered
  for an
 Intent.

 I dont know how the internals of how the off hook button works but
couldnt
 it broadcast an Intent to go off hook which then can be handled
  like
any
 other intent. To avoid the annoying situation of having to choose an
  app
 every time a changeable default could be setup.
 (Like how RingDroid replaces the default ringtone picker)

 On Mon, Nov 3, 2008 at 3:15 PM, hackbod [EMAIL PROTECTED] wrote:

  Correct, you can't steal it from other apps.  When your apps is in
  the
  foreground, however, you will see the key as a normal key event
  that
  you can process however you want.

  On Nov 3, 1:11 pm, Shawn [EMAIL PROTECTED] wrote:
   I don't think you would be allowed to remap the phone button that
would
  force people to use your app even if they didn't want to and my be
  considered malacious. That's just an opinion though

   -Original Message-
   From: [EMAIL PROTECTED] [EMAIL PROTECTED]

   Date: Mon, 3 Nov 2008 13:09:53
   To: Android Developersandroid-developers@googlegroups.com
   Subject: [android-developers] hooking to the PHONE button

   Hi,

   How can I make my own application run whenever the user presses
  the
   green PHONE button ?

   TIA
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: hooking to the PHONE button

2008-11-04 Thread hackbod

The green phone key is for use by the foreground application.

On Nov 3, 7:34 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
 It shouldnt be stolen but it should be overridable.
 Much like the app picker behaves when multiple apps are registered for an
 Intent.

 I dont know how the internals of how the off hook button works but couldnt
 it broadcast an Intent to go off hook which then can be handled like any
 other intent. To avoid the annoying situation of having to choose an app
 every time a changeable default could be setup.
 (Like how RingDroid replaces the default ringtone picker)

 On Mon, Nov 3, 2008 at 3:15 PM, hackbod [EMAIL PROTECTED] wrote:

  Correct, you can't steal it from other apps.  When your apps is in the
  foreground, however, you will see the key as a normal key event that
  you can process however you want.

  On Nov 3, 1:11 pm, Shawn [EMAIL PROTECTED] wrote:
   I don't think you would be allowed to remap the phone button that would
  force people to use your app even if they didn't want to and my be
  considered malacious. That's just an opinion though

   -Original Message-
   From: [EMAIL PROTECTED] [EMAIL PROTECTED]

   Date: Mon, 3 Nov 2008 13:09:53
   To: Android Developersandroid-developers@googlegroups.com
   Subject: [android-developers] hooking to the PHONE button

   Hi,

   How can I make my own application run whenever the user presses the
   green PHONE button ?

   TIA
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: hooking to the PHONE button

2008-11-04 Thread Declan Shanaghy
It doesn't seem that way.
No matter what application I am in if I press the green phone button the
recent call log comes up.


What about when the user is on the home screen?





On Tue, Nov 4, 2008 at 12:22 AM, hackbod [EMAIL PROTECTED] wrote:


 The green phone key is for use by the foreground application.

 On Nov 3, 7:34 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
  It shouldnt be stolen but it should be overridable.
  Much like the app picker behaves when multiple apps are registered for an
  Intent.
 
  I dont know how the internals of how the off hook button works but
 couldnt
  it broadcast an Intent to go off hook which then can be handled like
 any
  other intent. To avoid the annoying situation of having to choose an app
  every time a changeable default could be setup.
  (Like how RingDroid replaces the default ringtone picker)
 
  On Mon, Nov 3, 2008 at 3:15 PM, hackbod [EMAIL PROTECTED] wrote:
 
   Correct, you can't steal it from other apps.  When your apps is in the
   foreground, however, you will see the key as a normal key event that
   you can process however you want.
 
   On Nov 3, 1:11 pm, Shawn [EMAIL PROTECTED] wrote:
I don't think you would be allowed to remap the phone button that
 would
   force people to use your app even if they didn't want to and my be
   considered malacious. That's just an opinion though
 
-Original Message-
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
 
Date: Mon, 3 Nov 2008 13:09:53
To: Android Developersandroid-developers@googlegroups.com
Subject: [android-developers] hooking to the PHONE button
 
Hi,
 
How can I make my own application run whenever the user presses the
green PHONE button ?
 
TIA
 


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: hooking to the PHONE button

2008-11-04 Thread hackbod

Oh the -default- handling of the green key is this:

private void startCallActivity() {
Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(intent);
}


So you can write an activity that implements that action.  You can -
not- however generally intercept the green key: if the app handles it
yourself (such as pressing the green key while highlighting a phone
number to place a call) you won't run.

On Nov 4, 4:23 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
 It doesn't seem that way.
 No matter what application I am in if I press the green phone button the
 recent call log comes up.

 What about when the user is on the home screen?

 On Tue, Nov 4, 2008 at 12:22 AM, hackbod [EMAIL PROTECTED] wrote:

  The green phone key is for use by the foreground application.

  On Nov 3, 7:34 pm, Declan Shanaghy [EMAIL PROTECTED] wrote:
   It shouldnt be stolen but it should be overridable.
   Much like the app picker behaves when multiple apps are registered for an
   Intent.

   I dont know how the internals of how the off hook button works but
  couldnt
   it broadcast an Intent to go off hook which then can be handled like
  any
   other intent. To avoid the annoying situation of having to choose an app
   every time a changeable default could be setup.
   (Like how RingDroid replaces the default ringtone picker)

   On Mon, Nov 3, 2008 at 3:15 PM, hackbod [EMAIL PROTECTED] wrote:

Correct, you can't steal it from other apps.  When your apps is in the
foreground, however, you will see the key as a normal key event that
you can process however you want.

On Nov 3, 1:11 pm, Shawn [EMAIL PROTECTED] wrote:
 I don't think you would be allowed to remap the phone button that
  would
force people to use your app even if they didn't want to and my be
considered malacious. That's just an opinion though

 -Original Message-
 From: [EMAIL PROTECTED] [EMAIL PROTECTED]

 Date: Mon, 3 Nov 2008 13:09:53
 To: Android Developersandroid-developers@googlegroups.com
 Subject: [android-developers] hooking to the PHONE button

 Hi,

 How can I make my own application run whenever the user presses the
 green PHONE button ?

 TIA
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: hooking to the PHONE button

2008-11-03 Thread hackbod

Correct, you can't steal it from other apps.  When your apps is in the
foreground, however, you will see the key as a normal key event that
you can process however you want.

On Nov 3, 1:11 pm, Shawn [EMAIL PROTECTED] wrote:
 I don't think you would be allowed to remap the phone button that would force 
 people to use your app even if they didn't want to and my be considered 
 malacious. That's just an opinion though

 -Original Message-
 From: [EMAIL PROTECTED] [EMAIL PROTECTED]

 Date: Mon, 3 Nov 2008 13:09:53
 To: Android Developersandroid-developers@googlegroups.com
 Subject: [android-developers] hooking to the PHONE button

 Hi,

 How can I make my own application run whenever the user presses the
 green PHONE button ?

 TIA
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: hooking to the PHONE button

2008-11-03 Thread Declan Shanaghy
It shouldnt be stolen but it should be overridable.
Much like the app picker behaves when multiple apps are registered for an
Intent.

I dont know how the internals of how the off hook button works but couldnt
it broadcast an Intent to go off hook which then can be handled like any
other intent. To avoid the annoying situation of having to choose an app
every time a changeable default could be setup.
(Like how RingDroid replaces the default ringtone picker)



On Mon, Nov 3, 2008 at 3:15 PM, hackbod [EMAIL PROTECTED] wrote:


 Correct, you can't steal it from other apps.  When your apps is in the
 foreground, however, you will see the key as a normal key event that
 you can process however you want.

 On Nov 3, 1:11 pm, Shawn [EMAIL PROTECTED] wrote:
  I don't think you would be allowed to remap the phone button that would
 force people to use your app even if they didn't want to and my be
 considered malacious. That's just an opinion though
 
  -Original Message-
  From: [EMAIL PROTECTED] [EMAIL PROTECTED]
 
  Date: Mon, 3 Nov 2008 13:09:53
  To: Android Developersandroid-developers@googlegroups.com
  Subject: [android-developers] hooking to the PHONE button
 
  Hi,
 
  How can I make my own application run whenever the user presses the
  green PHONE button ?
 
  TIA
 


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---