Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Contributor
Posts: 4
Registered: ‎04-06-2011
My Device: 9800
My Carrier: Vodafone

Can not read message in proper format from BlackBerry

I've developed a code that will send sms from BlackBerry to other phones(not necessarily blackberry). I'm getting the message .




Below is code snippet for generating the contents:


final byte[] myUDH = new byte[] {0x06,0x05,   0x04,  0x04, (byte) 0xd2, 0x04, (byte) 0xd2 };
  maxDatagramLength -= myUDH.length;
  try {
   message = finalvalue.getBytes("UTF-8");
  } catch (UnsupportedEncodingException e) {
  // building the actual SMS payload
  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); 



= smsConnection.newDatagram(completePayload.length);


d).setAddressBase(destinationAddr);d.setData(completePayload, 0, completePayload.length);



When we recieve this message on blackberry device, the message gets displayed properly. But the message content is always "null" in other devices(We need to send sms to all type of phones).


Any help in this matter will be appreciated.