Re: [android-developers] Re: AlarmManager with alarm icon

2011-01-19 Thread Marcin Orlowski
On 19 January 2011 20:25, Dianne Hackborn  wrote:

> We haven't yet figured out an API to allow third party apps to do this in a 
>sane way, so there is a

Side note: if you'd be adding API for this please consider adding a
way to keep (left ones in this case) notification icons in "permanent"
order. Sometimes I got icons A B C and when other notification appear,
are cleared etc the order changes and it's i.e. B C A. My app uses
notification icon all the time (say like battery indicator etc do) and
far too many users asked if I could make my icon stick to the left
most part of notification area. Would be nice if I could do that in
the clean way (or the user could)

-- 
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] Re: AlarmManager with alarm icon

2011-01-19 Thread Marcin Orlowski
On 19 January 2011 18:32, Andy Savage  wrote:
> It's not a notification as far as I can tell. It appears on the RIGHT

Ah, my bad. Seems I thought of the other right ;)

-- 
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] Re: AlarmManager with alarm icon

2011-01-19 Thread Dianne Hackborn
Note that when you see a raw string like that
("android.intent.action.ALARM_CHANGED"
and "alarmSet"), warning bells should be going off in your head that this is
using private APIs.

And indeed this is.

If you use this, don't be surprised if it breaks in the future on randomly
doesn't work on some devices.

Some background on this: application notifications are supposed to go on the
left side of the status bar.  However, the UI designers really really really
wanted the "alarm set" icon to be on the right.  We haven't yet figured out
an API to allow third party apps to do this in a sane way, so there is a
private facility for the built-in alarm clock to do it.

If/when a public API ever appears for this, it will very much not be in its
currently implemented form, and any apps relying on these private
implementation details will break.

On Wed, Jan 19, 2011 at 10:41 AM, Andy Savage  wrote:

> Good plan, I didn't think of that. In case anyone is searching for
> this solution in the future, the in built alarm sets the icon by
> broadcasting an intent. I acheived this with the following code:
>
>protected void setStatusBarIcon(boolean enabled) {
>Intent alarmChanged = new
> Intent("android.intent.action.ALARM_CHANGED");
>alarmChanged.putExtra("alarmSet", enabled);
>sendBroadcast(alarmChanged);
>}
>
> (Done within the scope an Activity, else you will need to pass a
> Context).
>
>
> On Jan 19, 6:18 pm, TreKing  wrote:
> > On Wed, Jan 19, 2011 at 12:01 PM, Andy Savage 
> wrote:
> > > Both "Klaxon" and "Alarm Clock Plus" do this (Both have free
> > > versions available on market if you want to take a look).
> >
> > So it does. I would grab the built-in alarm source code and see what it's
> > doing. I'd bet that's what they did.
> >
> >
> -
> > TreKing  - Chicago
> > transit tracking app for Android-powered devices
>
> --
> 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
>



-- 
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: AlarmManager with alarm icon

2011-01-19 Thread Andy Savage
Good plan, I didn't think of that. In case anyone is searching for
this solution in the future, the in built alarm sets the icon by
broadcasting an intent. I acheived this with the following code:

protected void setStatusBarIcon(boolean enabled) {
Intent alarmChanged = new
Intent("android.intent.action.ALARM_CHANGED");
alarmChanged.putExtra("alarmSet", enabled);
sendBroadcast(alarmChanged);
}

(Done within the scope an Activity, else you will need to pass a
Context).


On Jan 19, 6:18 pm, TreKing  wrote:
> On Wed, Jan 19, 2011 at 12:01 PM, Andy Savage  wrote:
> > Both "Klaxon" and "Alarm Clock Plus" do this (Both have free
> > versions available on market if you want to take a look).
>
> So it does. I would grab the built-in alarm source code and see what it's
> doing. I'd bet that's what they did.
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
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] Re: AlarmManager with alarm icon

2011-01-19 Thread TreKing
On Wed, Jan 19, 2011 at 12:01 PM, Andy Savage  wrote:

> Both "Klaxon" and "Alarm Clock Plus" do this (Both have free
> versions available on market if you want to take a look).
>

So it does. I would grab the built-in alarm source code and see what it's
doing. I'd bet that's what they did.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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: AlarmManager with alarm icon

2011-01-19 Thread Andy Savage
Both "Klaxon" and "Alarm Clock Plus" do this (Both have free versions
available on market if you want to take a look).

On Jan 19, 5:49 pm, TreKing  wrote:
> On Wed, Jan 19, 2011 at 11:32 AM, Andy Savage  wrote:
> > It's not a notification as far as I can tell. It appears on the RIGHT
> > hand side next to the time (Along with the other "in built" icons,
> > such as battery, connectivity etc). It doesn't appear in the app
> > specific list of notifications on the LEFT, or the notification drop
> > down list, or have associated text.
>
> What app(s) do(es) this? Sounds like a hack.
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
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] Re: AlarmManager with alarm icon

2011-01-19 Thread TreKing
On Wed, Jan 19, 2011 at 11:32 AM, Andy Savage  wrote:

> It's not a notification as far as I can tell. It appears on the RIGHT
> hand side next to the time (Along with the other "in built" icons,
> such as battery, connectivity etc). It doesn't appear in the app
> specific list of notifications on the LEFT, or the notification drop
> down list, or have associated text.
>

What app(s) do(es) this? Sounds like a hack.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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: AlarmManager with alarm icon

2011-01-19 Thread Andy Savage
It's not a notification as far as I can tell. It appears on the RIGHT
hand side next to the time (Along with the other "in built" icons,
such as battery, connectivity etc). It doesn't appear in the app
specific list of notifications on the LEFT, or the notification drop
down list, or have associated text.

On Jan 19, 5:27 pm, Marcin Orlowski  wrote:
> On 19 January 2011 18:19, Andy Savage  wrote:
>
> > I'm setting wake up alarms for a custom app using
> > AlarmManager.set(). This correctly registers an "alarm" and the
> > app is launched at the desired time. It doesn't however give a visual
> > alarm indicator in the notification bar (RIGHT hand side, next to the
> > time).
>
> AlarmManager is for alarms. Not alarms + icons + shower + cofee :)
>
> > How do I set this?
>
> http://developer.android.com/guide/topics/ui/notifiers/notifications
>
> > I have seen 3rd party alarm apps which trigger this icon to display.
> > They also cause a toast along the lines of "Alarm scheduled for x
> > hours from now", which may be part of the process. Obviously it's
> > quite easy to generate that toast manually, but I'm wondering if that
> > is integrated too?
>
> If it's easy why should it be integrated? To make more problems in
> case you do *not* want it? Framework/OS gives you single bricks,
> not whole walls. And it should be that way, for many reasons incl.
> fexibility.

-- 
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