04-23-2010 01:55 AM
public void readPIMEvents() {
System.out.println("entered into read") ;
try {
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)
{
Dialog.alert("in for");
id = fieldIds[index];
Dialog.alert("hello"+ event.getPIMList().getFieldDataType(id));
for(int j=0; j < event.countValues(id); ++j)
{
String value = event.getString(id, j);
Dialog.alert(eventList.getFieldLabel(id)+"="+value );
}
}
}
}
catch(PIMException ds) {
System.out.println("Exception::"+ds.getMessage().t oString());
}
}
Hi,
i am using the given below code for reading calander events but its read only summery and location but i need to acees all the details associated wiyh calander events.please help me.
04-23-2010 02:17 AM
Hello sreehari434,
I am not sure but I think you can't access all the fields. But you can access StartTime and EndTime.
The code for Accessing start time and end time is as follows
_startTime = new DateField("Start: ", System.currentTimeMillis() +
3600000, DateField.DATE_TIME);
_endTime = new DateField("End: ", System.currentTimeMillis() +
7200000, DateField.DATE_TIME);
04-23-2010 02:23 AM
hi,
this code just give time but i need start and end time of each events i am reading.please help me.
04-23-2010 03:30 AM
Hi guys,
start_date and end_date are long values. You should use PIMItem.getDate() instead of PIMItem.getString(). You can also check field type by PIMEvent.getFieldDataType().
Thanks,
Eugen