I've got a problem and couldn't find the solution anywhere.
I want to use my application to send a special sms (so that another phone can get it, and use it to do some things).
I was using the easiest way:
Using java Syntax Highlighting
- Intent sendIntent = new Intent(Intent.ACTION_VIEW);
- sendIntent.putExtra("sms_body", mysms);
- sendIntent.setType("vnd.android-dir/mms-sms");
- startActivity(sendIntent);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
The problem is that the sms seems to be too big sometimes, and the end is removed in this case, which is a problem.
So, I tried to use another method:
Using java Syntax Highlighting
- SmsManager sms = SmsManager.getDefault();
- ArrayList<String> mysmslist = sms.divideMessage(mysms);
- ArrayList<PendingIntent> listOfIntents = new ArrayList<PendingIntent>();
- for (int i=0; i < mysmslist.size(); i++)
- {
- Intent sentIntent = new Intent();
- sentIntent.putExtra("SMS_ADDRESS_PARAM", "5556");
- sentIntent.putExtra("SMS_DELIVERY_MSG_PARAM", (mysmslist.size() > 1)? "Part " + i + " of SMS " : "SMS ");
- PendingIntent pi = PendingIntent.getBroadcast(this, 0, sentIntent, PendingIntent.FLAG_CANCEL_CURRENT);
- listOfIntents.add(pi);
- }
- sms.sendMultipartTextMessage("5556", null, mysmslist, listOfIntents, null);
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
It seemed to be okay, but... No! When I receive the messages, it's only a whole bunch of weird symbols. I saw that some other people got the same problem, but does anyone knows how to solve it? Or how to send a big sms without it to be cropped?
Thank you!!

