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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
mbasheerk
Posts: 268
Registered: ‎02-02-2009
Accepted Solution

copy Calendar event

[ Edited ]

Hi friends,

 

Can I copy the blackberry calender event to my application?, How?

 

Thanks in advances

Message Edited by mbasheerk on 05-27-2009 05:48 AM
Message Edited by mbasheerk on 05-27-2009 08:00 AM
Please use plain text.
Developer
samuels007
Posts: 21
Registered: ‎02-11-2009

Re: copy Calendar event

Hi,

 

yes you can read the calendar events thruogh PIM interface and Evetlist class.

 

Below is the sample code.For more info read the EventList API documentation.

 

EventList eventList = (EventList)PIM.getInstance().openPIMList(
PIM.EVENT_LIST, PIM.READ_ONLY);
Enumeration e = eventList.items();

while (e.hasMoreElements()) {
Event event = (Event)e.nextElement();
int[] fieldIds = event.getFields();
int id;
for(int index = 0; index < fieldIds.length; ++index) {
id = fieldIds[index];
if(e.getPIMList().getFieldDataType(id) == STRING) {
for(int j=0; j < event.countValues(id); ++j) {
String value = event.getString(id, j);
System.out.println(event.getFieldLable(id) + "=" + value);

}

 

Please Cick on "Accept solution" if your problem is solved.

 

thanks

Please use plain text.
New Developer
hariprasad
Posts: 29
Registered: ‎07-18-2011
My Carrier: Developer

Re: copy Calendar event

what is STRING here

Please use plain text.