BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   What's the difference between Email and SMS message composing using Java api's (http://www.blackberryforums.com/developer-forum/181579-whats-difference-between-email-sms-message-composing-using-java-apis.html)

baskaraninfo 03-17-2009 05:53 AM

What's the difference between Email and SMS message composing using Java api's
 
I have been using the following to create an email message:

Quote:

Session session = Session.getDefaultInstance();
Store store = session.getStore();
// WHERE TO SAVE THE SEND MESSAGES
Folder[] folders = store.list(Folder.SENT);
Folder sentfolder = folders[0];
net.rim.blackberry.api.mail.Message msg = new net.rim.blackberry.api.mail.Message(sentfolder);
But, how can I create a SMS message using Java api? :?

Thanks

Dougsg38p 03-17-2009 07:18 AM

You need the other Message class: javax.wireless.messaging.Message

baskaraninfo 03-18-2009 01:58 AM

Code to send sms
 
I have used the following code to send the sms:

MessageConnection _dc = (MessageConnection)Connector.open("sms://"+number);
Message sms = _dc.newMessage(MessageConnection.TEXT_MESSAGE);
TextMessage sms2 = (TextMessage)sms;
sms2.setPayloadText(msg);
_dc.send(sms2);


All times are GMT -5. The time now is 02:22 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.