×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Feb 2010
    Posts
    78

    Post Read Meeting application in calender

    hi,

    am doing a read meeting application in j2me...where in that i have some 4 fields like Subject,Location,StartTime
    and EndTime....When i run my Application except for the "EndTime" all the other Fields works fine and am getting the output ...where when i use that EndTime am getting a Invalid Index Exception

    here is the code which i have used for the EndTime
    if(eventList.isSupportedField(Event.END) == true) {
    long endDate = event.getDate(Event.END,PIMItem.ATTR_NONE);
    }

    Can Anyone PLease help me

    Thnks In Advance
    Deva

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: Read Meeting application in calender

    Try PDAPDemo (PIM example from SUN wtk examples) on the same device and see if it can read the End time of the meetings.

    thanks,
    ~Amitabh

  3. #3
    Regular Contributor
    Join Date
    Feb 2010
    Posts
    78

    Post Re: Read Meeting application in calender

    Quote Originally Posted by im2amit View Post
    Try PDAPDemo (PIM example from SUN wtk examples) on the same device and see if it can read the End time of the meetings.

    thanks,
    ~Amitabh
    I have attached a code of my "reading the meeting application" from a calender .

    Code:
    private void readEvent(){ 
          Enumeration events =null;
          try {
              
                PIM    pim         =  PIM.getInstance();
                String listitem[]  =  pim.listPIMLists(PIM.EVENT_LIST);
                for(int i=0;i < listitem.length ;i++) {
                    System.out.println("Calender Types:"+listitem[i]);
                }
                                          // Get list of events...
                //EventList eventList =  (EventList)pim.openPIMList(PIM.EVENT_LIST, PIM.READ_ONLY,listitem[0]);
                EventList eventList = (EventList)PIM.getInstance().openPIMList(PIM.EVENT_LIST,PIM.READ_WRITE);
                events              =  eventList.items();
                //Event     event   =  eventList.createEvent();   // Create new event.
                
                while(events.hasMoreElements()) {
                    Event event = (Event)events.nextElement(); 
                                 // Get data from controls
                    if(eventList.isSupportedField(Event.SUMMARY) == true){
                         String summary = event.getString(Event.SUMMARY,PIMItem.ATTR_NONE);
                         System.out.println("printed summary ::"+summary);
                    }
                    else{
                               // At least summary must be supported.
                         eventList.close();
                         throw new Exception("Summary field for event is not supported");
                    }
                    if(eventList.isSupportedField(Event.START) == true) {
                        long startDate = event.getDate(Event.START,PIMItem.ATTR_NONE);
                        System.out.println("printed startDate ::"+startDate);
                    }
                    if(eventList.isSupportedField(Event.END) == true) {
                        long endDate = event.getDate(Event.END,PIMItem.ATTR_NONE);
                        System.out.println("printed endDate ::"+endDate );
                    }
                    if(eventList.isSupportedField(Event.NOTE) == true) {
                        String note = event.getString(Event.NOTE, PIMItem.ATTR_NONE);
                        System.out.println("printed note ::"+note);
                    }
                    if(eventList.isSupportedField(Event.LOCATION) == true) {
                        String location = event.getString(Event.LOCATION, PIMItem.ATTR_NONE);
                        System.out.println("printed location ::"+location);
                    }
                    
                }
                eventList.close();  
         }catch(PIMException pimExc) {
                // TODO: Handle error on working with PIM.
                showAlert("PIMException", pimExc.getMessage());
          }catch(SecurityException secExc) {
                // TODO: Handle error on access to PIM.
                showAlert("SecurityException", secExc.getMessage());
           }catch(Exception exc) {
                // TODO: Handle all other errors.
                showAlert("Exception", exc.getMessage());
           } 
    }
    where the above program works fine if am not using the "End time "....when end time is used i get
    a Invalid index Exception...


    Can u please help me.

    Thanks in advance
    Deva

Similar Threads

  1. Replies: 7
    Last Post: 2009-09-19, 14:55
  2. how to invoke calender in j2me application forS60 category
    By sreehari434 in forum Mobile Java General
    Replies: 2
    Last Post: 2009-07-14, 12:43
  3. Do Symbian rejects the Express Signing request on any Business Development ground?
    By arpit2agrawal in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 23
    Last Post: 2009-02-19, 10:46
  4. Replies: 1
    Last Post: 2008-05-08, 12:32
  5. "Allow application to read user data?"
    By giapage in forum Mobile Java General
    Replies: 3
    Last Post: 2008-04-02, 02:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×