Data corruption in Binary SMS

by mahantesh Hunagund » Tue, 03 Mar 2009 02:51:50 GMT

Sponsored Links

I am trying to send binary SMS. I am using android SDK 1.0_r2.  My
application is able to receive the SMS, but data I am receiving is
completely change from whatever I am sending.
Please help me in this regard.

My Code looks like
*byte[] data="Google".getBytes();*

*public* *class* smsReceiver *extends* BroadcastReceiver {

*private* *static* *final* String *SMS_RECEIVED* =

*public* *void* onReceive(Context context, Intent intent) {

*if* (intent.getAction().equals(*SMS_RECEIVED*)) {

Bundle bundle = intent.getExtras();

Object messages[] = (Object[]) bundle.get("pdus");

SmsMessage smsMessage[] = *new* SmsMessage[messages.length];

*for* (*int* n = 0; n < messages.length; n++) {

smsMessage[n] = SmsMessage.*createFromPdu*((*byte*[]) messages[n]);


*String str = new** String(smsMessage[0].getUserData());*

Toast toast = Toast.*makeText*(context, "Title: "+ str,Toast.*LENGTH_LONG*);

When I checked with the help of debugger, I am receiving "
4F b, b,  " instead of "Google".



Other Threads

1. is any method where we can set icon n text?

Hi All,
is any method where we can set icon n text issingle method?
Thank's in adv.
Diya :)


2. Timesheet and PocketPlay

I'd like to introduce - the new business web site and
partner site of

Since our team of developers wanted to code closed source as well as
open source applications, we decided to separate them more cleanly.
All open source applications carry the "OI" in their name, while the
closed source applications don't.

The first two applications that you can buy from our website are:

* Timesheet:  and
* PocketPlay:

As some of you may remember, PocketPlay actually started here in the
developer group with this post:

3. Exception is raised when remove the last item in ExpandedListView

4. Camera.PreviewCallback IOException

5. Usage of ArrayAdapter leads me to Index Array out of Bounds Exception

6. Separating ListView into Sections using Headers

7. Scrolling frustration - is this a feature or bug?