[android-developers] Re: targeting broadcasts issue

2009-07-05 Thread Dianne Hackborn
Sorry, if you want to have control over the notification, I think you will
need to implement it yourself.  I'm not an expert on the telephony APIs, but
I don't know of anywhere we have something that allows one application to
dismiss a notification owned by another.

On Fri, Jul 3, 2009 at 10:56 PM, Seer gilligan.ch...@gmail.com wrote:


 Then maybe you can help me as all i want to do is something very
 simple but i can't find a way to do so apart from what i am talking
 about above.

 I have an application reading and responding to sms.  It is an
 application that is an option when you click onthe standard sms
 notification that is built into the phone.  The issue is while this
 trigers my application correctly and my application displays the sms
 and marks it as read the notification on the notification bar never
 goes away.  To make the notification go away the use has to open the
 built in sms client and the notification goes away instantly.  All i
 want to do is triger the sms notification to update and to go away if
 there are no more un read sms.  Currently the only way i have found to
 do this is the end the broadcast i was talking about which get shte
 builtin sms application to check and update its notifications.

 I don't want to have to build an notification system and get users to
 disable built in notifications etc. firstly the built in one does
 exactly what i want and second it is complicated to get users to turn
 off notifications as they normally just complain thye get 2
 notifications.  I am not implementing the sms broadcast receiver just
 the Action.View for sms and mms.

 Does that make sense?  Do you understand what i am trying to do? Is
 there a better way to get the notifications to update?

 Chris


 On Jul 4, 2:04 pm, Dianne Hackborn hack...@android.com wrote:
  Um, don't do this.  Whatever you are doing this for, you can be sure it
 will
  break in the future.
 
 
 
  On Fri, Jul 3, 2009 at 8:55 PM, Seer gilligan.ch...@gmail.com wrote:
 
   Guys,
   I am trying to get the intent android.intent.action.BOOT_COMPLETED
   sent only to the receiver
   com.android.mms.transaction.MmsSystemEventReceiver as this triggers
   the sms notification to be updated and removed if there is no longer
   any unread sms's.  The issue i have is i need to make sure the
   broadcast is only sent to the class above.  If it goes to other
   receivers the phone could end up in an unknown state or something
   strange.
 
   The code below does not seem to work.
 
   Intent intent = new Intent();
   intent.setAction(android.intent.action.BOOT_COMPLETED);
   intent.setClassName(com.android.mms,
   .transaction.MmsSystemEventReceiver);
   activity.sendBroadcast(intent);
 
   This code does work but since it goes to all receivers i have noticed
   some errors starting to show up in logs etc.
   Intent intent = new Intent();
   intent.setAction(android.intent.action.BOOT_COMPLETED);
   activity.sendBroadcast(intent);
 
   Chris
 
  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com
 
  Note: please don't send private questions to me, as I don't have time to
  provide private support, and so won't reply to such e-mails.  All such
  questions should be posted on public forums, where I and others can see
 and
  answer them.
 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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] Re: targeting broadcasts issue

2009-07-05 Thread Seer

Dianne,
I really don't want control over the notification at all. I beleive
that i am either missing something or doing something the wrong way.
maybe you can tell me what i am doing wrong or know someone that could
point me in the wright direction.

My understanding of intents is that the whole point of them is so that
you can have multiple applications providing similar or the same
functionality and that those applications become interchangable via
intents. Now when a new sms comes in there is a notification in the
notification bar and that notification will allow any application
implementing the correct intent (action view and data of sms) to be
triggered from the notification to display the sms.  This part works
perfectly. The issues is that when the notification trigers my
application instead of the default messaging application the
notification never goes away.  I have marked the sms as read and done
everything i can think of to try to trigger it to update the
notification to either the next sms or to remove the notification.  I
am happy to post my code if that helps as i have to be missing
something.  It makes no sense to allow developers to offer alternative
applications via intents with the notifications and then have the
notification never go away.

I mean i have clicked th notification to trigger the intent and i have
marked the sms as read when my app loads the intent.  Is there
something else i need to do?  Fire some other intent or something?

This is all just an atempt to work around the issue
http://code.google.com/p/android/issues/detail?id=2261.  All i want to
do is allow my users to send sms over the internet.  The issues is why
you can implement an intent for a new sms half the sms my users send
are replies and since reply is built into most sms apps unless the
issue above is implemented you need to write an app to view sms so
that you can capture the replies hence what i am trying to do above.
I really want to keep this as simple as possible as this is only a
small part of my application but it is turning out to be the bigest
time consumer.

Chris


On Jul 6, 4:49 am, Dianne Hackborn hack...@android.com wrote:
 Sorry, if you want to have control over the notification, I think you will
 need to implement it yourself.  I'm not an expert on the telephony APIs, but
 I don't know of anywhere we have something that allows one application to
 dismiss a notification owned by another.



 On Fri, Jul 3, 2009 at 10:56 PM, Seer gilligan.ch...@gmail.com wrote:

  Then maybe you can help me as all i want to do is something very
  simple but i can't find a way to do so apart from what i am talking
  about above.

  I have an application reading and responding to sms.  It is an
  application that is an option when you click onthe standard sms
  notification that is built into the phone.  The issue is while this
  trigers my application correctly and my application displays the sms
  and marks it as read the notification on the notification bar never
  goes away.  To make the notification go away the use has to open the
  built in sms client and the notification goes away instantly.  All i
  want to do is triger the sms notification to update and to go away if
  there are no more un read sms.  Currently the only way i have found to
  do this is the end the broadcast i was talking about which get shte
  builtin sms application to check and update its notifications.

  I don't want to have to build an notification system and get users to
  disable built in notifications etc. firstly the built in one does
  exactly what i want and second it is complicated to get users to turn
  off notifications as they normally just complain thye get 2
  notifications.  I am not implementing the sms broadcast receiver just
  the Action.View for sms and mms.

  Does that make sense?  Do you understand what i am trying to do? Is
  there a better way to get the notifications to update?

  Chris

  On Jul 4, 2:04 pm, Dianne Hackborn hack...@android.com wrote:
   Um, don't do this.  Whatever you are doing this for, you can be sure it
  will
   break in the future.

   On Fri, Jul 3, 2009 at 8:55 PM, Seer gilligan.ch...@gmail.com wrote:

Guys,
I am trying to get the intent android.intent.action.BOOT_COMPLETED
sent only to the receiver
com.android.mms.transaction.MmsSystemEventReceiver as this triggers
the sms notification to be updated and removed if there is no longer
any unread sms's.  The issue i have is i need to make sure the
broadcast is only sent to the class above.  If it goes to other
receivers the phone could end up in an unknown state or something
strange.

The code below does not seem to work.

Intent intent = new Intent();
intent.setAction(android.intent.action.BOOT_COMPLETED);
intent.setClassName(com.android.mms,
.transaction.MmsSystemEventReceiver);
activity.sendBroadcast(intent);

This code does work but since it goes to all receivers i have 

[android-developers] Re: targeting broadcasts issue

2009-07-05 Thread Mark Murphy

Seer wrote:
 My understanding of intents is that the whole point of them is so that
 you can have multiple applications providing similar or the same
 functionality and that those applications become interchangable via
 intents.

That is generally correct.

 Now when a new sms comes in there is a notification in the
 notification bar and that notification will allow any application
 implementing the correct intent (action view and data of sms) to be
 triggered from the notification to display the sms.

That is true, as far as it goes. However, as near as I can tell from the
Android source code, that notification was raised by the built-in
messaging application:

http://tinyurl.com/o4t4cl

Since the built-in messaging application raised the notification, it has
to clear it; no other application context can do so, AFAIK.

What you may want to do is find a way, if there is one, to arrange to
consume the SMS message yourself and put up your own notification,
rather than let the built-in messaging application handle it.

 It makes no sense to allow developers to offer alternative
 applications via intents with the notifications and then have the
 notification never go away.

Intents are used in more places than notifications. The notion of having
alternative applications responding to the same Intent would appear to
be aimed more at things like startActivity() than notifications.

That being said, I can imagine there being some way to enhance Android
to allow applications who handle the Intent sent from a Notification to
be able to cancel that same Notification.

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

_Android Programming Tutorials_ Version 1.0 Available!

--~--~-~--~~~---~--~~
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] Re: targeting broadcasts issue

2009-07-05 Thread Dianne Hackborn
Yeah currently notifications are very much owned by the app that created
them, and there is no facility for other apps to interact with them.  As you
say, one could imagine a way for apps to replace handling of notifications,
but it's not something we have defined support for at this point.

On Sun, Jul 5, 2009 at 3:42 PM, Mark Murphy mmur...@commonsware.com wrote:


 Seer wrote:
  My understanding of intents is that the whole point of them is so that
  you can have multiple applications providing similar or the same
  functionality and that those applications become interchangable via
  intents.

 That is generally correct.

  Now when a new sms comes in there is a notification in the
  notification bar and that notification will allow any application
  implementing the correct intent (action view and data of sms) to be
  triggered from the notification to display the sms.

 That is true, as far as it goes. However, as near as I can tell from the
 Android source code, that notification was raised by the built-in
 messaging application:

 http://tinyurl.com/o4t4cl

 Since the built-in messaging application raised the notification, it has
 to clear it; no other application context can do so, AFAIK.

 What you may want to do is find a way, if there is one, to arrange to
 consume the SMS message yourself and put up your own notification,
 rather than let the built-in messaging application handle it.

  It makes no sense to allow developers to offer alternative
  applications via intents with the notifications and then have the
  notification never go away.

 Intents are used in more places than notifications. The notion of having
 alternative applications responding to the same Intent would appear to
 be aimed more at things like startActivity() than notifications.

 That being said, I can imagine there being some way to enhance Android
 to allow applications who handle the Intent sent from a Notification to
 be able to cancel that same Notification.

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

 _Android Programming Tutorials_ Version 1.0 Available!

 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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] Re: targeting broadcasts issue

2009-07-03 Thread Dianne Hackborn
Um, don't do this.  Whatever you are doing this for, you can be sure it will
break in the future.

On Fri, Jul 3, 2009 at 8:55 PM, Seer gilligan.ch...@gmail.com wrote:


 Guys,
 I am trying to get the intent android.intent.action.BOOT_COMPLETED
 sent only to the receiver
 com.android.mms.transaction.MmsSystemEventReceiver as this triggers
 the sms notification to be updated and removed if there is no longer
 any unread sms's.  The issue i have is i need to make sure the
 broadcast is only sent to the class above.  If it goes to other
 receivers the phone could end up in an unknown state or something
 strange.

 The code below does not seem to work.

 Intent intent = new Intent();
 intent.setAction(android.intent.action.BOOT_COMPLETED);
 intent.setClassName(com.android.mms,
 .transaction.MmsSystemEventReceiver);
 activity.sendBroadcast(intent);

 This code does work but since it goes to all receivers i have noticed
 some errors starting to show up in logs etc.
 Intent intent = new Intent();
 intent.setAction(android.intent.action.BOOT_COMPLETED);
 activity.sendBroadcast(intent);

 Chris
 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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] Re: targeting broadcasts issue

2009-07-03 Thread Seer

Then maybe you can help me as all i want to do is something very
simple but i can't find a way to do so apart from what i am talking
about above.

I have an application reading and responding to sms.  It is an
application that is an option when you click onthe standard sms
notification that is built into the phone.  The issue is while this
trigers my application correctly and my application displays the sms
and marks it as read the notification on the notification bar never
goes away.  To make the notification go away the use has to open the
built in sms client and the notification goes away instantly.  All i
want to do is triger the sms notification to update and to go away if
there are no more un read sms.  Currently the only way i have found to
do this is the end the broadcast i was talking about which get shte
builtin sms application to check and update its notifications.

I don't want to have to build an notification system and get users to
disable built in notifications etc. firstly the built in one does
exactly what i want and second it is complicated to get users to turn
off notifications as they normally just complain thye get 2
notifications.  I am not implementing the sms broadcast receiver just
the Action.View for sms and mms.

Does that make sense?  Do you understand what i am trying to do? Is
there a better way to get the notifications to update?

Chris


On Jul 4, 2:04 pm, Dianne Hackborn hack...@android.com wrote:
 Um, don't do this.  Whatever you are doing this for, you can be sure it will
 break in the future.



 On Fri, Jul 3, 2009 at 8:55 PM, Seer gilligan.ch...@gmail.com wrote:

  Guys,
  I am trying to get the intent android.intent.action.BOOT_COMPLETED
  sent only to the receiver
  com.android.mms.transaction.MmsSystemEventReceiver as this triggers
  the sms notification to be updated and removed if there is no longer
  any unread sms's.  The issue i have is i need to make sure the
  broadcast is only sent to the class above.  If it goes to other
  receivers the phone could end up in an unknown state or something
  strange.

  The code below does not seem to work.

  Intent intent = new Intent();
  intent.setAction(android.intent.action.BOOT_COMPLETED);
  intent.setClassName(com.android.mms,
  .transaction.MmsSystemEventReceiver);
  activity.sendBroadcast(intent);

  This code does work but since it goes to all receivers i have noticed
  some errors starting to show up in logs etc.
  Intent intent = new Intent();
  intent.setAction(android.intent.action.BOOT_COMPLETED);
  activity.sendBroadcast(intent);

  Chris

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---