1: send SMS
String body = "this is MMS Demo ";
Intent mmsintent = new intent (intent. action_sendto, Uri. fromparts ("smsto", number, null ));
Mmsintent. putextra (messaging. key_action_sendto_message_body, body );
Mmsintent. putextra (messaging. key_action_sendto_compose_mode, true );
Mmsintent. putextra (messaging. key_action_sendto_exit_on_sent, true );
Startactivity (mmsintent );
2: Send MMS
Stringbuilder sb = new stringbuilder ();
SB. append ("file ://");
SB. append (FD. getabsolutefile ());
Intent intent = new intent (intent. action_sendto, Uri. fromparts ("mmsto", number, null ));
// Below extra datas are all optional.
Intent. putextra (messaging. key_action_sendto_message_subject, subject );
Intent. putextra (messaging. key_action_sendto_message_body, body );
Intent. putextra (messaging. key_action_sendto_content_uri, SB. tostring ());
Intent. putextra (messaging. key_action_sendto_compose_mode, composemode );
Intent. putextra (messaging. key_action_sendto_exit_on_sent, exitonsent );
Startactivity (intent );
3: Send mail
Mime = "img/jpg ";
Using intent. setdataandtype (URI. fromfile (FD), mime );
Extends intent. putextra (intent. extra_stream, Uri. fromfile (FD ));
Specify intent. putextra (intent. extra_subject, subject );
Extends intent. putextra (intent. extra_text, body );
Post: http://hi.baidu.com/jiang_yy_jiang/blog/item/72191b00b7efa002738b6543.html
Slave --------------------------------------------------------------------------------------------------------------------------------
Development Using eclipse on Windows is different from development using Unix environment. You can use the following code on Windows to send the code. Make sure to modify the code yourself.
Intent intent = new intent (intent. action_send );
Intent. addflags (intent. flag_activity_new_task );
Intent. putextra ("Address", phnumber );
Intent. putextra ("compose_mode", false );
Intent. putextra ("exit_on_sent", true );
Intent. putextra ("subject", "MMS test ");
Intent. putextra ("sms_body", "this is MMS send auto ");
Intent. putextra (intent. extra_stream, Uri. parse ("file: // sdcard/ima.jpg "));
Intent. setclassname ("com. Android. MMS", "com. Android. mms. UI. composemessageactivity ");
Intent. settype ("image/JPEG ");
Startactivity (intent. createchooser (intent, "Send MMs "));
Post: http://www.eoeandroid.com/thread-21150-1-1.html
Certificate -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
When sending an email:No application can perform this action or no application can perform this operation,
The following code solves the problem:
String mailId=(String)ContactUs.this.getString(R.string.contactus8); Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts( "mailto",mailId, null)); //emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{mailId}); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,body); startActivity(emailIntent);
Tip: http://www.coderanch.com/t/520651/Android/Mobile/no-application-perform-action-when