android - Send MMS programmatically -


i want send mms programmatically used following code

    intent sendintent1 = new intent(intent.action_send);      try {          sendintent1.settype("text/x-vcard");         sendintent1.putextra("address","0475223091");         sendintent1.putextra("sms_body","hello..");         sendintent1.putextra(intent.extra_stream,                 uri.parse(vcffile.tourl().tostring()));     } catch (malformedurlexception e) {         // todo auto-generated catch block         e.printstacktrace();     }     startactivity(sendintent1); 

the problem directing compose message page , requires manually send sms , dont want without notification should send how can it??

somebody please share me answer

i found solution works 100%. please refer github project https://github.com/klinker41/android-smsmms. (anyone find usefull please donate author http://forum.xda-developers.com/showthread.php?t=2222703).

notice, obligatory settings

settings sendsettings = new settings();  sendsettings.setmmsc(mmsc); sendsettings.setproxy(proxy); sendsettings.setport(port); 

you can them (found @ set apn programmatically on android - answear vincent091):

cursor cursor = null; if (utils.hasics()){     cursor =sqlitewrapper.query(activity, activity.getcontentresolver(),              uri.withappendedpath(carriers.content_uri, "current"), apn_projection, null, null, null); } else {     cursor = activity.getcontentresolver().query(uri.withappendedpath(telephony.carriers.content_uri, "current"),         null, null, null, null); }  cursor.movetolast(); string type = cursor.getstring(cursor.getcolumnindex(telephony.carriers.type)); string mmsc = cursor.getstring(cursor.getcolumnindex(telephony.carriers.mmsc)); string proxy = cursor.getstring(cursor.getcolumnindex(telephony.carriers.mmsproxy)); string port = cursor.getstring(cursor.getcolumnindex(telephony.carriers.mmsport)); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -