I am developing and simple application in blackberry JDE 6. My application will listen to any incoming or outgoing event i.e SMS event, MMS event, Email Event. After the occurrence of those event. App will prompt user about event and will do some processing.
for listening to SMS and MMS event i am implementing the OutboundMessageListener interface and passing it to the MessageConnection class object as shown belowe.
i have found the protocol for SMS and MMS (sms:// and mms://) referred to this link Connector class protocol support
for SMS and MMS i am using this code to listen to the events
MessageConnection sms= (MessageConnection)Connector.open("sms://:0");
sms.setMessageListener(customPhoneListener);
MessageConnection mms = (MessageConnection) Connector.open("mms://0");
mms.setMessageListener(customPhoneListener);
But for email i am not able to find any protocol like sms and mms
how can i listen to email events any idea ?? any help appreciated :)
I have tried using the below code (jst to try even if i knw its not correct) to listen to email event but no luck as expected
MessageConnection email = (MessageConnection) Connector.open("email://0");
email.setMessageListener(customPhoneListener);
Take a look at net.rim.blackberry.api.mail.event.FolderListener and Store.addFolderListener()