20
BlackBerry Device Applications Integration Guide
}//end if
}//end for loop
}//end else if
Notify an application that an email message is about to be sent
1.
Create a class that implements
net.rim.blackberry.api.mail.SendListener
.
public class mailSendListener implements SendListener{
2.
Create an instance of the subclass.
mailSendListener mailSL = new mailSendListener();
3. In a try block, retrieve the
Store
object.
try {
Store store = Session.waitForDefaultSession().getStore();
}
4. In a catch block, manage a
NoSuchServiceException
.
catch (NoSuchServiceException e) {
System.out.println(e.toString());
}
5. Add a
SendListener
instance.
store.addSendListener(mailSL);
Notify an application that an MMS message is about to be sent
1.
Create a class that implements
net.rim.blackberry.api.mms.SendListener
.
public class mmsSendListener implements SendListener{
2.
Create an instance of the subclass.
mmsSendListener mmsSL = new mmsSendListener();
3. Add a
SendListener
instance.
MMS.addSendListener(mmsSL);
Notify an application that an SMS message is about to be sent
1.
Create a class that implements
net.rim.blackberry.api.sms.SendListener
.
public class smsSendListener implements SendListener{
2.
Create an instance of the subclass.
smsSendListener smsSL = new smsSendListener();
3. Add a
SendListener
.
SMS.addSendListener(smsSL);
Summary of Contents for JAVA DEVELOPMENT ENVIRONMENT - - DEVICE APPLICATIONS INTEGRATION - DEVELOPMENT GUIDE
Page 4: ......
Page 7: ......
Page 10: ...10 BlackBerry Device Applications Integration Guide...
Page 12: ...12 BlackBerry Device Applications Integration Guide...
Page 50: ...50 BlackBerry Device Applications Integration Guide...
Page 56: ...56 BlackBerry Device Applications Integration Guide...
Page 65: ......
Page 66: ...2008 Research In Motion Limited Published in Canada...