Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 172
Registered: ‎04-19-2010
My Device: Bold 9700

How to get recurring events and alarms from calendar

[ Edited ]

Hi @all,

 

I'm trying to get all events from calendar in the following way:

 

 

    	Enumeration matches = events.items(EventList.OCCURRING,
startTime,endTime,true); while (matches.hasMoreElements()) {
           .
           .
           .
        }

 This works fine for all entries but "recurring events" and "alarms".

 Remark: the initial event of the recurring series will be got with the code above, but not the rest of the series.

 Example: today is 09. November 2010. If you start a recurring series today, the code above will get the present entry. If you start the series on 09. November 2009, todoy you will not be able to retrieve information about the recurring event.

 

How do I get recurring events and alarms?

 

any idea or link would be very helpfull.

 

thanks in advance

 

cua

michael

 

cu
michael
--------------------------------------------------------------------------------------------------------------------------
please give kudos to thank everyone who helped you or put you in the right direction.
please mark the thread as solved, if you found your solution.
Developer
Posts: 172
Registered: ‎04-19-2010
My Device: Bold 9700

Re: How to get recurring events and alarms from calendar

In addition to that:

 

I don't want to read the whole PIM-Database.

I just want to get all events including, standard non recurring, recurring and alarms (and all things, which I'm not thinking that they are existing) within a given date.

How can I do this?

 

thanks in advane.

 

michael

cu
michael
--------------------------------------------------------------------------------------------------------------------------
please give kudos to thank everyone who helped you or put you in the right direction.
please mark the thread as solved, if you found your solution.
Developer
Posts: 172
Registered: ‎04-19-2010
My Device: Bold 9700

Re: How to get recurring events and alarms from calendar

no ideas at all?
cu
michael
--------------------------------------------------------------------------------------------------------------------------
please give kudos to thank everyone who helped you or put you in the right direction.
please mark the thread as solved, if you found your solution.
Developer
Posts: 172
Registered: ‎04-19-2010
My Device: Bold 9700

Re: How to get recurring events and alarms from calendar

?

cu
michael
--------------------------------------------------------------------------------------------------------------------------
please give kudos to thank everyone who helped you or put you in the right direction.
please mark the thread as solved, if you found your solution.
Developer
Posts: 172
Registered: ‎04-19-2010
My Device: Bold 9700

Re: How to get recurring events and alarms from calendar

I think, this problem is heavier than I thought.

 

I hope you get what I mean!?

 

I try to get all events within a given date, say today. Non recurring events, recurring events, alarms etc.

With the code in the posting of my first thread, I get only non recurring events, the first occurence of an recurring event, but not the other recurring events or alarms. I tried searching within a template, but without success.

I looked all over the internet during last friday, the only examples I get are how to initiate alarms or recurring events. But how to read them are not shown.

Perhaps I have a knot in my brain ;-)

 

Any idea will be very helpfull.

 

Thanks in advance

 

cu

michael

cu
michael
--------------------------------------------------------------------------------------------------------------------------
please give kudos to thank everyone who helped you or put you in the right direction.
please mark the thread as solved, if you found your solution.
Developer
Posts: 1,452
Registered: ‎11-06-2009
My Device: Torch 9810
My Carrier: WiFi

Re: How to get recurring events and alarms from calendar

For recuring events you can check if

RepeatRule rule = event.getRepeat();

if rule != null, so the event is recurring

 

with RepeatRule

dates(long startDate, long subsetBeginning, long subsetEnding)

you can check if the event is repeating in a given time span



"When you become a level 3 developer, you learn to communicate over the ether. I'm told that level 5 developers are ascend into a higher level of existence beyond the physical realm." gord888 @ crackberry
Developer
Posts: 172
Registered: ‎04-19-2010
My Device: Bold 9700

Re: How to get recurring events and alarms from calendar

that is what i already know.

what i want, is to get all occurences within a given date.
i don't want to get all entries in the calendar db and check for repeatrules.
i just want to get one days events including normal events, recurring and alarms.
with my code, the events i get, never are recurring events or alarms, so i can't use getRepeat.

cu
michael
cu
michael
--------------------------------------------------------------------------------------------------------------------------
please give kudos to thank everyone who helped you or put you in the right direction.
please mark the thread as solved, if you found your solution.
Developer
Posts: 172
Registered: ‎04-19-2010
My Device: Bold 9700

Re: How to get recurring events and alarms from calendar

I looked for other j2me sites, but no success.

 

anyone knowing links for the problem?

 

thanks.

 

cu
michael
--------------------------------------------------------------------------------------------------------------------------
please give kudos to thank everyone who helped you or put you in the right direction.
please mark the thread as solved, if you found your solution.
Developer
Posts: 172
Registered: ‎04-19-2010
My Device: Bold 9700

Re: How to get recurring events and alarms from calendar

Shame on me!!!

 

I found the solution of one part(recurring event):

 

Enumeration matches = events.items(EventList.OCCURRING,
startTime,endTime,true);

 should be changed to:

 

 

Enumeration matches = events.items(EventList.OCCURRING,
startTime,endTime,false);

 

 

If the last parameter is "true", only the first instance of a recurring event will be get back.

 

But within alarms in calendar, I got no solution yet.

 

thanks

 

 

cu
michael
--------------------------------------------------------------------------------------------------------------------------
please give kudos to thank everyone who helped you or put you in the right direction.
please mark the thread as solved, if you found your solution.