BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 06-01-2007, 08:06 AM   #1 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default info: Sending SMS

Please Login to Remove!

we used to have a DatagramConnection for sending sms but found out that there is a bug. We had our application corrupting the first SMS it sended each time, all following were ok, quite strange.

Maybe there are more people who find this information valuable thus our new code:

Code:
msg= messageField.getText();         
            MessageConnection _dc = (MessageConnection)Connector.open("sms://"+mobilnummer);                 
            Message sms = _dc.newMessage(MessageConnection.TEXT_MESSAGE);
            TextMessage sms2 = (TextMessage)sms;
            sms2.setPayloadText(msg);                     
            _dc.send(sms2);
the casting is a bit irky but it works. It seems you can not create a TextMessage as the constructor of MessageConnection always creates a Message-object, the setPayload-function requires a TextMessage-object though.
If you have a solution without casting please post it as a reply,
the code above works fine.
__________________
java developer, Devinto, hamburg/germany
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Electronic Ballast, Fluorescent For T12 Lamps 2-Lamp 120V B234Sr120M-A000I New
$23.25
Electronic Ballast, Fluorescent For T12 Lamps 2-Lamp 120V B234Sr120M-A000I New pictureIlluminating Experiences PERONI ADA PL wRobertson Fluorescent Ballast 120V 60Hz
$25.0
Illuminating Experiences PERONI ADA PL wRobertson Fluorescent Ballast 120V 60Hz  pictureUniversal Triad B259IUNVHP-A Fluorescent Electronic Ballast (2) F96T8 Lamps
$14.99
Universal Triad B259IUNVHP-A Fluorescent Electronic Ballast (2) F96T8 Lamps picture ADVANCE RL2SP20TP RL-2SP20-TP FLUORESCENT BALLAST 120V 60Hz FOR (2)F20T12+
$29.99
 ADVANCE RL2SP20TP RL-2SP20-TP FLUORESCENT BALLAST 120V 60Hz FOR (2)F20T12+ picture(LOT OF 10) F32T8 2-LAMP BALLAST FIXTURE PHILIPS ICN-2P32-N F25T8 F17T8 W/ BASE
$74.99
(LOT OF 10) F32T8 2-LAMP BALLAST FIXTURE PHILIPS ICN-2P32-N F25T8 F17T8 W/ BASE picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.