| Reply | « Previous Thread | Next Thread » |
|
Hello,
When I create a recurrent event with the following code, I manage to create the event, which is recurrent, on my Nokia N95 8Gb (SW Version V20.0.016). The issue comes when I try to synchronize the calendar with this brand new recurrent event with PC Suite (I use 7.1.18.0). I get an error message like "La vue Calendrier n'a pas pu lire les entrées de votre périphérique", which is the french version for "cannot read event etries from your device", I guess. I extracted this which I think is the minimal code to get this error message. I get it only with recurrent events, and the phone manages to handle the event. Is this a PC Suite bug or should I add some parameters when creating the event ? Thanks, Gaggou Code:
package gaggou;
import java.util.Calendar;
import java.util.Date;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.StringItem;
import javax.microedition.midlet.*;
import javax.microedition.pim.Event;
import javax.microedition.pim.EventList;
import javax.microedition.pim.PIM;
import javax.microedition.pim.PIMItem;
import javax.microedition.pim.RepeatRule;
public class eventKiller extends MIDlet {
public void startApp() {
String text = "All OK";
EventList events = null;
Date aDate = Calendar.getInstance().getTime();
try {
events = (EventList) PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);
Event event = events.createEvent();
if (events.isSupportedField(Event.SUMMARY)) {
event.addString(Event.SUMMARY, PIMItem.ATTR_NONE, "Meeting with John");
}
text += "summary OK\n";
if (events.isSupportedField(Event.START)) {
event.addDate(Event.START, PIMItem.ATTR_NONE, aDate.getTime());
}
text += "Start OK\n";
if (events.isSupportedField(Event.END)) {
event.addDate(Event.END, PIMItem.ATTR_NONE, aDate.getTime() + 60000);
}
text += "End OK\n";
if (events.isSupportedField(Event.NOTE)) {
event.addString(Event.NOTE, PIMItem.ATTR_NONE, "I phoned on Monday to book this meeting");
}
text += "Note OK\n";
RepeatRule repeatRule = new RepeatRule();
repeatRule.setInt(RepeatRule.FREQUENCY, RepeatRule.WEEKLY);
event.setRepeat(repeatRule);
text += "Recurrence OK\n";
event.commit();
text += "Commit OK\n";
events.close();
} catch (Exception e) {
text += e.getMessage();
}
Display.getDisplay(this).setCurrent(new Form("Welcome", new Item[]{new StringItem("Result : ", text)}));
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Nokia N95 8GB adds Flash Lite 3 support | biskero | Flash Lite on Nokia Devices | 17 | 2008-02-15 22:59 |
| Questions about N95 8GB | nick_santa83 | Python | 12 | 2008-02-05 05:24 |
| 2 questions on the N95 8GB... | Stephan.van.Zyl | General Discussion | 1 | 2008-01-10 00:46 |
| when will n95 8gb be available?? | genting | General Discussion | 2 | 2007-09-22 05:13 |
| NOKIA N95 Battery Issue (Please discuss all Nokia N95 battery issue here) | Waqar | General Discussion | 3 | 2007-09-17 02:24 |