Blackberry JAVA DEVELOPMENT ENVIRONMENT - - DEVICE APPLICATIONS INTEGRATION - DEVELOPMENT GUIDE Integration Manual page 29

Blackberry device applications integration guide
Table of Contents

Advertisement

Task
Add appointment information.
Create a recurring appointment.
Change appointment information.
Steps
>
To verify that an item supports a field, invoke
if (event.isSupportedField(Event.SUMMARY)) {
event.addString(Event.SUMMARY, Event.ATTR_NONE, "Meet with customer");
}
if (event.isSupportedField(Event.LOCATION)) {
event.addString(Event.LOCATION, Event.ATTR_NONE, "Conference Center");
}
Date start = new Date(System.currentTimeMillis() + 8640000);
if (event.isSupportedField(Event.START)) {
event.addDate(Event.START, Event.ATTR_NONE, start);
}
if (event.isSupportedField(Event.END)) {
event.addDate(Event.END, Event.ATTR_NONE, start + 72000000);
}
if (event.isSupportedField(Event.ALARM)) {
if (event.countValues(Event.ALARM) > 0) {
event.removeValue(Event.ALARM,0);
event.setInt(Event.ALARM, 0, Event.ATTR_NONE, 396000);
}
}
RepeatRule
1. Create a
object. The
that you can set, such as COUNT, FREQUENCY, and INTERVAL.
2. To retrieve an array of supported fields, invoke
3. To define a recurring pattern, invoke
long)
RepeatRule
on a new
RepeatRule recurring = new RepeatRule();
recurring.setInt(RepeatRule.FREQUENCY, RepeatRule.MONTHLY);
recurring.setInt(RepeatRule.DAY_IN_MONTH, 14);
4. To assign a recurrence pattern to an appointment, invoke
event.
EventList eventList = (EventList)PIM.getInstance().openPIMList(
PIM.EVENT_LIST, PIM.READ_WRITE);
Event event = eventList.createEvent();
event.setRepeat(recurring);
1. To replace an existing value with a new one, invoke the appropriate set method, such as
setString()
.
2. To determine if a value is already set for the field, invoke
3. To change an existing value, use the corresponding set method, such as s
if (event.countValues(Event.LOCATION) > 0) {
event.setString(Event.LOCATION, 0, Event.ATTR_NONE, "Board Room");
}
isSupportedField(int)
RepeatRule
class defines fields for the properties and values
RepeatRule.getFields()
setInt(int, int)
setDate(int, int, int,
or
object.
setRepeat(RepeatRule)
countValues().
4: Using the calendar
.
.
on an
etString()
.
29

Advertisement

Table of Contents
loading

This manual is also suitable for:

Java development environment 4.6.0

Table of Contents