I am using SmsManager sendDataMessage funtion to send byte[] to
another device. I was using port 8888 to send message. I was working
fine, but suddenly after one day or so it stoped working.(without
single line of change).
I tried to set different ports - 80, 8080, 16001, 12345
But still it is not working. Message is not getting received at
receiving end.
Sending Code :
------
short port = 8888;
sms.sendDataMessage("5556", null, port, "hello world", null, null);
Receiving code:
------
public void onReceive(Context context, Intent intent)
{
Bundle bundle = intent.getExtras();
SmsMessage[] msgs = null;
if(null != bundle)
{
String info = "Binary SMS from ";
Object[] pdus = (Object[]) bundle.get("pdus");
msgs = new SmsMessage[pdus.length];
byte[] data = null;
for (int i=0; i<msgs.length; i++){
msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);
info += msgs[i].getOriginatingAddress();
info += "\n*****BINARY MESSAGE*****\n";
data = msgs[i].getUserData();
for(int index=0; index<data.length; ++index)
{
info +=
Character.toString((char)data[index]);
}
}
Toast.makeText(context, info,
Toast.LENGTH_SHORT).show();
}
}
}
Manifest file is modified for Intent filter.
I think like native Messaging application there is limit on number of
binary SMS.
If yes, how set/change limit, if there is storage for same, how to
delete it.
I tried closing and starting emulator again also tried to restore
phone setting to factory setting.
Please help me, I am stuck from last few days.
Thanks in advance.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en