Send a big sms

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

Send a big sms

Postby Sebeto » Fri Aug 28, 2009 2:59 pm

Hi everybody!

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:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent sendIntent = new Intent(Intent.ACTION_VIEW);
  2.  
  3. sendIntent.putExtra("sms_body", mysms);
  4.  
  5. sendIntent.setType("vnd.android-dir/mms-sms");
  6.  
  7. startActivity(sendIntent);
Parsed in 0.030 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:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. SmsManager sms = SmsManager.getDefault();
  2.  
  3. ArrayList<String> mysmslist = sms.divideMessage(mysms);
  4.  
  5. ArrayList<PendingIntent> listOfIntents = new ArrayList<PendingIntent>();
  6.  
  7. for (int i=0; i < mysmslist.size(); i++)
  8.  
  9. {  
  10.  
  11.    Intent sentIntent = new Intent();
  12.  
  13.    sentIntent.putExtra("SMS_ADDRESS_PARAM", "5556");
  14.  
  15.    sentIntent.putExtra("SMS_DELIVERY_MSG_PARAM", (mysmslist.size() > 1)? "Part " +  i + " of SMS " : "SMS ");
  16.  
  17.    PendingIntent pi = PendingIntent.getBroadcast(this, 0, sentIntent, PendingIntent.FLAG_CANCEL_CURRENT);  
  18.  
  19.    listOfIntents.add(pi);  
  20.  
  21. }
  22.  
  23. 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!!
Sebeto
Sebeto
Freshman
Freshman
 
Posts: 3
Joined: Fri Aug 28, 2009 2:38 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: Exabot [Bot] and 4 guests