android - Sending multipart SMS from device converting into MMS -


after looking on th e website, not able find solution problem. let me explain bit more :

i'm trying send (programmatically) app multipart sms. it's working on device (nexus 4) tried on galaxy note, convert long-sized sms mms , app send short sms. clue that? samsung api or prevent sendmultiparttextmessage() method being executed?

in sending function, have log debug, shown on screen, call function done..

thanks help!

here code use :

public static void sendsms(final activity a, string phonenumber, string message) {             try {         smsmanager sms = smsmanager.getdefault();         arraylist<string> parts = sms.dividemessage(message);           arraylist<pendingintent> sendintents = new arraylist<pendingintent>(parts.size());         (int = 0; < sendintents.size(); i++)         {             intent sendint = new intent("");             pendingintent sendresult = pendingintent.getbroadcast(a.getapplicationcontext(), 0, sendint, pendingintent.flag_one_shot);             sendintents.add(sendresult);         }          sms.sendmultiparttextmessage(phonenumber, null, parts, null, null);         contentvalues values = new contentvalues();          values.put("address", phonenumber);         values.put("body", message);           a.getapplicationcontext().getcontentresolver().insert(uri.parse("content://sms/sent"), values);     } catch(exception e) {         e.printstacktrace(system.out);     } } 

    public void sendsms(string phonenumber, string longmessage) {     try {          smsmanager sms = smsmanager.getdefault();         arraylist<string> parts = sms.dividemessage(longmessage);         sms.sendmultiparttextmessage(phonenumber, null, parts, null, null);      } catch (exception ex) {         ex.printstacktrace();     }    } 

add permission :

<uses-permission android:name="android.permission.send_sms"/> 

above code works on samsung galaxy note 2 (android 4.1.1), micromax hd canvas (android 4.1.1) , samsung galaxy s3 (android 4.1.1), htc 1 x (android 4.0).

so function not block me on samsung phones.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -