Hi,
There's nothing built-in for that. If I were to implement that, I would:
1) Write some code that queries the Calendar provider and have
AlarmManager wake up the phone and send you an intent at the
appropriate times for the remainder of "today". This method may be
called more frequently then needed. You will should keep track of what
you have scheduled or not so you don't schedule anything
unnecessarily.
2) Have AlarmManager wake you up at midnight so you can call method #1
3) Listen for the ACTION_BOOT_COMPLETED broadcast so you can schedule
your midnight alarm and call method #1. Alarms do not persist across
reboots.
4) Listen for android.intent.action.PROVIDER_CHANGED so you know when
something has changed and you know... call method #1.
<intent-filter>
<action android:name="android.intent.action.PROVIDER_CHANGED"/>
<data android:scheme="content"/>
<data android:host="com.android.calendar"/>
</intent-filter>
5) Listen for the date, time, and timezone change broadcasts and again
call method #1.
I think that should cover all the cases.
Thanks,
Mike
On Fri, Mar 2, 2012 at 3:50 AM, Forum JD <[email protected]> wrote:
> I am using android ICS new calendar API. I want to do some action when an
> event from calendar start and stops. Say for example I have a meeting in my
> calender at 5.30 Saturday to 6.00 PM i want to do some action at 5.29 and
> 6.01 PM. Is there any listener that I can configure for such events? I can
> read the event details from calender and write a lot of custom code to do so
> but just wanted to know if there is any other mechanism to do so? In case I
> need to read all the event details in calender, is there any service which I
> can use which calls back my class at a certain time? Just like springs
> scheduler or something?
>
> JD
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> 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
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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