BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 09-21-2009, 02:48 AM   #1 (permalink)
New Member
 
Join Date: Sep 2009
Model: 9530
PIN: N/A
Carrier: GSM
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Funky characters got appended with sms when sms send using DatagramConnection

Please Login to Remove!

Hi,
I am new to BB application development itried to write an application for sending multiple messages in a loop in the emulator it works fine . But when tested in the phone some special charcters are appeneded to the sms ie
two or three characters then the sms.The method in which i had send sms using the following code

DatagramConnection smsConnection =
(DatagramConnection)Connector.open("sms://18001234567:9876");
SmsAddress destinationAddr = new SmsAddress("//18001234567:9876");
SMSPacketHeader header = destinationAddr.getHeader();
header.setStatusReportRequest(false);
header.setUserDataHeaderPresent(true);
header.setValidityPeriod(SMSParameters.PERIOD_INDE FINITE);
header.setDeliveryPeriod(SMSParameters.PERIOD_INDE FINITE);
header.setMessageClass(SMSParameters.MESSAGE_CLASS _1);
header.setMessageCoding(SMSParameters.MESSAGE_CODI NG_8_BIT);
int maxDatagramLength = smsConnection.getMaximumLength();
final byte myUDH = new byte[] {
0x06, 0x05, 0x04, 0x04, 0xd2, 0x04, 0xd2 };
maxDatagramLength -= myUDH.lenth;
byte[] message = "Bonjour de Montréal".getBytes("UTF-8");
byte[] completePayload = new byte[myUDH.length + message.length];
System.arraycopy(myUDH, 0, completePayload, 0, myUDH.length);
System.arraycopy(message, 0, completePayload,
myUDH.length, message.length);
Datagram d = smsConnection.newDatagram(completePayload.length);
((DatagramBase)d).setAddressBase(destinationAddr);
d.setData(completePayload, 0, completePayload.length);
smsConnection.send(d);


i tried with MessageConnection also in that case i encountered the problem in emulator too . does any have a work around. please post a working code or give some suggestion.

Thank you in advance.
Offline  
Old 09-21-2009, 09:42 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2008
Model: 8520
OS: 5.0.0.509
PIN: N/A
Carrier: TMo
Posts: 176
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

:d.........

Last edited by kellyjdrummer : 09-21-2009 at 09:45 PM.
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

1Pcs MRF847 NPN silicon RF power transistor
$16.99
1Pcs MRF847 NPN silicon RF power transistor  picture100pcs BD139 NPN power transistors TO-126
$4.29
100pcs BD139 NPN power transistors TO-126 picture1Pcs MRF5S21130 TRANSISTOR
$24.99
1Pcs MRF5S21130 TRANSISTOR pictureSet x2 : IRL 3705 N - HEXFET Power MOSFET L3705N - transistor IRL3705N A12)
$7.41
Set x2 : IRL 3705 N - HEXFET Power MOSFET L3705N - transistor IRL3705N A12) picture50 PCS AP02N60H TO-252 02N60H 2N60 600V N-Channel MOSFET
$18.99
50 PCS AP02N60H TO-252 02N60H 2N60 600V N-Channel MOSFET picture






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