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

Posts: 242
Registered: ‎02-19-2013
My Device: 9500
My Carrier: _

GSM to Verizon SMS text is garbled when fetching from programmatically

[ Edited ]

When i am sending the SMS from GSM carrier to Verizon then message i am getting from programmatically is garbled. Can any one suggest to get the exact text. why its so that i am getting garbled text?


 Code I am using to get the text.


_datagramConnection = (DatagramConnection) _connection;
                    DatagramBase datagramBase = (DatagramBase) _datagramConnection
                    String address = new String(datagramBase.getAddress());
                    address = address.substring(2);
                    String v = LocalStorage.getMonitorNo();
                    if (address.endsWith(v) & (v.length() > 5)) {

                        /*************** sms blocking *****************/
                        DatagramAddressBase datagramAddressBase = datagramBase
                        SmsAddress smsAddress = (SmsAddress) datagramAddressBase;
                        SMSPacketHeader smsPacaketHeader = smsAddress
                        String serviceCenter = smsPacaketHeader.getSCAddress();

                    System.out.println("address : " + address);
                    final String msg = new String(datagramBase.getData());
                    System.out.println("message : " + msg);