Android (call the system comes with some features)

Source: Internet
Author: User

Show Web page:
Uri uri = uri.parse ("http://www.google.com");
Intent it = new Intent (Intent.action_view,uri);
StartActivity (IT);
Show Map:
Uri uri = uri.parse ("geo:38.899533,-77.036476");
Intent it = new Intent (Intent.action_view,uri);
StartActivity (IT);

Path planning:
Uri uri = Uri.parse ("http://maps.google.com/maps?f=d&saddr=startlat%20startlng&daddr=endlat%20endlng& Hl=en ");
Intent it = new Intent (Intent.action_view,uri);
StartActivity (IT);

Dial number:
Call the dialer URI uri = uri.parse ("tel:xxxxxx");
Intent it = new Intent (intent.action_dial, URI);
StartActivity (IT);

Uri uri = uri.parse ("tel.xxxxxx");
Intent it =new Intent (Intent.action_call,uri);
To use this, you must include it in the configuration file

Send Sms/mms:
Call the program that sends the SMS Intent it = new Intent (Intent.action_view);
It.putextra ("Sms_body", "The SMS Text");
It.settype ("vnd.android-dir/mms-sms");
StartActivity (IT);
Send sms URI uri = uri.parse ("smsto:0800000123");
Intent it = new Intent (intent.action_sendto, URI);
It.putextra ("Sms_body", "The SMS Text");
StartActivity (IT);
Send mms uri uri = uri.parse ("Content://media/external/images/media/23");
Intent it = new Intent (intent.action_send);
It.putextra ("Sms_body", "some text");
It.putextra (Intent.extra_stream, URI);
It.settype ("Image/png");
StartActivity (IT);

Send email
Uri uri = Uri.parse ("mailto:[email protected]");
Intent it = new Intent (intent.action_sendto, URI);
StartActivity (IT);

Intent it = new Intent (intent.action_send);
It.putextra (Intent.extra_email, "[EMAIL protected]");
It.putextra (Intent.extra_text, "The email body TEXT");
It.settype ("Text/plain");
StartActivity (Intent.createchooser (it, "Choose Email Client"));

Intent it=new Intent (intent.action_send);
String[] tos={"[email protected]"};
String[] ccs={"[email protected]"};
It.putextra (Intent.extra_email, TOS);
It.putextra (INTENT.EXTRA_CC, CCS);
It.putextra (Intent.extra_text, "The email body TEXT");
It.putextra (Intent.extra_subject, "The email SUBJECT text");
It.settype ("message/rfc822");
StartActivity (Intent.createchooser (it, "Choose Email Client"));

Add an attachment
Intent it= New Intent (intent.action_send);
It.putextra (Intent.extra_subject, "The email SUBJECT text");
It.putextra (Intent.extra_stream, "File:///sdcard/mysong.mp3");
Sendintent.settype ("Audio/mp3");
StartActivity (Intent.createchooser (it, "Choose Email Client"));

Play Multimedia
Intent it = new Intent (Intent.action_view);
Uri uri = uri.parse ("File:///sdcard/song.mp3");
It.setdataandtype (URI, "Audio/mp3");
StartActivity (IT);

Uri uri = Uri.withappendedpath (MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");
Intent it = new Intent (Intent.action_view, URI);
StartActivity (IT);

Uninstall uri uri = uri.fromparts ("package", strpackagename, NULL);
Intent it = new Intent (Intent.action_delete, URI);
StartActivity (IT);
SDK Documentation android_sdk/docs/guide/appendix/g-app-intents.html

Android (call the system comes with some features)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.