Wirelessly a code that solves dialing, positioning, Web, uninstall, install, play, mail, SMS

Source: Internet
Author: User

//The following is the URI of the frequently used intent and its demo sample, including the common intent used in most applications. 002 003//First, open a Web page, the category is Intent.action_view004 005 URI uri = Uri.parse ("http://blog.3gstdy.com/"); 006 007 Intent Intent =NewIntent (Intent.action_view, URI); 008//Open the map and navigate to a point009 010 URI uri = uri.parse ("geo:52.76,-79.0342″); 011 012 Intent Intent =NewIntent (Intent.action_view, URI); 013 014//Third, open the dial-up interface, type is intent.action_dial015 016 URI uri = uri.parse ("tel:10086″); 017 018 Intent Intent =NewIntent (intent.action_dial, URI); 019 020//four, direct call, with three different is, this direct call. Instead of opening the dial-up interface021 022 uri uri = Uri.parse ("tel:10086″); 023 024 Intent Intent =NewIntent (Intent.action_call, URI); 025 026//Five, uninstall an application, the category of intent is Intent.action_delete027 028 uri uri = Uri.fromparts (" Package"," xxx ",NULL); 029 030 Intent Intent =NewIntent (Intent.action_delete, URI); 031 032//Six, install the application, Intent category is intent.action_package_added033 034 uri uri = Uri.fromparts (" Package"," xxx ",NULL); 035 036 Intent Intent =NewIntent (intent.action_package_added, URI); 037 038//Seven, play audio files039 040 uri uri = Uri.parse ("File:///sdcard/download/everything.mp3″); 041 042 Intent Intent =NewIntent (Intent.action_view, URI); 043 044 intent.settype ("audio/Mp3″); 045 046//Eight, open the outgoing mail interface047 048 Uri uri=uri.parse ("Mailto:[email protected]"); 049 050 Intent Intent =NewIntent (Intent.action_sendto, URI); 051 052//Nine, e-mail, and eight different here is to send the mail out,053 054 Intent Intent =NewIntent (intent.action_send); 055 056 string[] tos ={"[Email protected]"}; 057 058 string[] CCS ={"[Email protected]"}; 059 060Intent.putextra (Intent.extra_email, TOS); 061 062Intent.putextra (INTENT.EXTRA_CC, CCS); 063 064 Intent.putextra (Intent.extra_text, "I come from http://blog.3gstdy.com "); 065 066 Intent.putextra (intent.extra_subject, "http://blog.3gstdy.com "); Intent.settype (" Message/rfc882″ "); 067 068Intent.createchooser (Intent, "Choose Email Client"); 069 070//send a message with an attachment071 072 Intent Intent =NewIntent (intent.action_send); 073 074Intent.putextra (Intent.extra_subject, "The email SUBJECT text"); 075 076 Intent.putextra (intent.extra_stream, "file:///sdcard/mysong.mp3″); 077 078 intent.settype ("audio/Mp3″); 079 080startactivity (Intent.createchooser (Intent, "Choose Email Client")); 081 082//10. Send SMS083 084 Uri uri= uri.parse ("tel:10086″); 085 086 Intent Intent =NewIntent (Intent.action_view, URI); 087 088 Intent.putextra ("Sms_body", "I come from http://blog.3gstdy.com "); 089 090 Intent.settype ("VND. android-dir/mms-SMS "); 091 092//11. Send email directly093 094 Uri uri= uri.parse ("Smsto://100861″); 095 096 Intent Intent =NewIntent (Intent.action_sendto, URI); 097 098 Intent.putextra ("Sms_body", "3g Android http://blog.3gstdy.com "); 099 100//12, send MMS101 102 Uri uri= Uri.parse ("content://Media/external/images/media/23″); 103 104 Intent Intent =NewIntent (intent.action_send); 106 Intent.putextra ("Sms_body", "3g Android http://blog.3gstdy.com "); 107 108Intent.putextra (Intent.extra_stream, URI); 109 Intent.settype ("image/png "); 111 112//13. # Market Related113 114//1//Find an appThe URI uri = Uri.parse ("Market://Search?

Q=pname:pkg_name "); 117 118 Intent It = new Intent (Intent.action_view, URI); 119 StartActivity (IT); 121 122 //where Pkg_name is the full package, path for an application 123 124 // 2 // display information about an app. 126 uri uri = Uri.parse ("Market://details? ")

Id=app_id ");127 Intent It =NewIntent (Intent.action_view, URI); 129 130startactivity (IT); 131 132//where app_id is the application ID, find the ID133 134//By clicking on your application in market home135 136//page, and notice the ID from the address bar137 138//14. Path Planning139 the URI uri = Uri.parse ("http://maps.google.com/maps?f=d&saddr=startlat%20startlng&daddr=endlat%20endlng&hl=en "); 141 142 Intent It =NewIntent (Intent.action_view, URI); 143 144 startactivity (IT);

Wirelessly a code that solves dialing, positioning, Web, uninstall, install, play, mail, SMS

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.