Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 13:04, 24 January 2008.

How to list the supported fields in a PIMList

From Forum Nokia Wiki


When using PIM API and its PIMList class, it is important to find out first, what fields are supported by the implementation. This can be done by using the following kind of method:

private void readSupportedFields() {
	System.out.println("EventList contents:");        
	try {
		String[] lists = PIM.getInstance().listPIMLists(PIM.EVENT_LIST);
		int length = lists.length;
		EventList[] eventList = new EventList[length];
		for (int i = 0; i < length; i++) {
			eventList[i] = (EventList) PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE, lists[i]);
			System.out.println(i+1+": "+lists[i]);
			int[] fields = eventList[i].getSupportedFields();
			System.out.println("Supported fields:");
			for (int j = 0; j < fields.length-1; j++) {
				System.out.println(fields[j]+" ");
			}
		}           
	} catch (PIMException pe) {
	  // no such list
	} catch (SecurityException se) {
	  // MIDlet is not allowed to access to the specified list
	}
}

If you need to know the supported fields in contact list or to-do list, just replace PIM.EVENT_LIST with PIM.CONTACT_LIST or PIM.TODO_LIST. Note, that you will get only the constant values of the fields, so output might look like this: 1: Meeting Supported fields: 108 107 100 106 102. The actual field names can be found from PIM API specification.

See also: How to list extended fields of ContactList.

Related Discussions
Thread Thread Starter Forum Replies Last Post
6590 not receiving push messages from external gateway avero General Browsing 1 2002-11-11 12:53
Alphabets-only form fields? advocatee General Symbian C++ 0 2003-07-27 08:46
supported picture formats on series 40 phones peower Mobile Java General 1 2002-07-30 06:46
TCoeInputCapabilities tolnaisz General Symbian C++ 0 2002-12-17 14:24
What is the meaning of SMSC in MMSC CDR header ? ask_expert General Messaging 1 2002-06-18 15:44
 
Powered by MediaWiki