/*** Send audio ** @ Param file audio file */private void mms_audio (File file) {intent = new intent (intent. action_send, Uri. parse ("MMS: //"); intent. setclassname ("com. android. MMS "," com. android. MMS. UI. composemessageactivity "); Uri fileuri = queryuriforaudio (File); intent. putextra (intent. extra_stream, fileuri); intent. settype ("audio/*"); // startactivity (intent); startactivity (intent. createchooser (intent, "MMS :"));}
The following methods are collected and sent through the intent provided by Android. For details, see the code.
/***** Send MMS * @ Param file address * @ Param body */private void sendmms_image (string file, string body) {intent = new intent (intent. action_send); intent. setclassname ("com. android. MMS "," com. android. MMS. UI. composemessageactivity "); intent. putextra ("subject", "MMS topic"); intent. putextra ("sms_body", body); intent. putextra ("Address", "12222222"); intent. putextra (intent. extra_stream, Uri. parse (filedir + file); intent. settype ("image/*"); startactivity (intent);}/*** send SMS * @ Param file body */private void sendsms (string file) {intent = new intent (intent. action_send); intent. setclassname ("com. android. MMS "," com. android. MMS. UI. composemessageactivity "); intent. putextra ("subject", "SMS subject"); intent. putextra ("sms_body", file); intent. putextra ("Address", "12222222"); intent. settype ("text/plain"); startactivity (intent );}
private void slideShow(File f1,File f2){ArrayList<Uri> uris = new ArrayList<Uri>();final Intent mmsIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);mmsIntent.setType("*/*");//mmsIntent.setType("*/*");mmsIntent.putExtra("address", "0123456");mmsIntent.putExtra("sms_body", "the body");//mmsIntent.putExtra(name, value)//Uri u= queryUriforAudio(f1);uris.add(queryUriforAudio(f1));uris.add(Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/"+"text.txt")));uris.add(Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/"+getText("image/jpeg")[0])));uris.add(queryUriForVideo(f2));//mmsIntent.putpmmsIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);//this.startActivityForResult(Intent.createChooser(mmsIntent, "success"), 1);startActivity(mmsIntent);}
/*** Send the video file * @ Param file the video file */private void mms_video (File file) {intent = new intent (intent. action_send, Uri. parse ("MMS: //"); intent. setclassname ("com. android. MMS "," com. android. MMS. UI. composemessageactivity "); Uri fileuri = queryuriforvideo (File); intent. putextra (intent. extra_stream, fileuri); intent. settype ("Video/*"); startactivity (intent. createchooser (intent, "MMS :"));}