Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EventList Read/Write  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing an application that read anw write EventList on mobile.

But one problem in reading this.

The Program can't read the data.

The program is like this.

Please help me.

public void show_EVENT_LIST()
{
System.out.println("show_EVENT_LIST");

try
{
EventList events;
PIM pim = PIM.getInstance();
events = (EventList)pim.openPIMList(PIM.EVENT_LIST,PIM.READ_ONLY);

Event event;
Enumeration enum = events.items();

while( enum.hasMoreElements())
{
event = (Event) enum.nextElement();

int field[] = event.getFields();

System.out.println("field.length >" + field.length);

for(int i=0;i<field.length;i++)
{
if(events.isSupportedField(field[i]))
{
int index[] = events.getSupportedAttributes(field[i]);

System.out.println(events.getFieldLabel(field[i]));

for(int j=0;j<index.length;j++)
{
if(events.isSupportedAttribute(field[i],index[j]))
{
System.out.print(events.getAttributeLabel(index[j])+" > ");

switch(events.getFieldDataType(field[i]))
{
case PIMItem.INT:
System.out.println(event.getInt(field[i],index[j]));
break;
case PIMItem.DATE:
System.out.println(new Date(event.getDate(field[i],index[j])));
break;
case PIMItem.STRING:
System.out.println((String)event.getString(field[i],j));
break;
default:
System.out.println("default");
break;
}
break;
}
}
}
}
event = null;
}

events.close();

}
catch (UnsupportedFieldException e){System.out.println("Event not saved");}
catch (PIMException e){System.out.println("Exception occured in add_EVENT_LIST() ");}
}
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!