1. Search for content from Google
Intent intent = new intent ();
Intent. setaction (intent. action_web_search );
Intent. putextra (searchmanager. query, "searchstring ")
Startactivity (intent );
2. Browse the webpage
Uri uri = URI. parse (http://www.google.com ");
Intent it = new intent (intent. action_view, Uri );
Startactivity (it );
3. display a map
Uri uri = URI. parse ("Geo: 38.899533,-77.036476 ″);
Intent it = new intent (intent. action_view, Uri );
Startactivity (it );
4. Route Planning
Uri uri = URI. parse ("http://maps.google.com/maps ?" +
"F = dsaddr = startlat startlng & daddr = endlat endlng & HL = EN ");
Intent it = new intent (intent. action_view, Uri );
Startactivity (it );
5. Call
Uri uri = URI. parse ("Tel: xxxxxx ");
Intent it = new intent (intent. action_dial, Uri );
Startactivity (it );
You need to add the permission <uses-Permission id = "android. Permission. call_phone">
6. Call the SMS Program
Intent it = new intent (intent. action_view );
It. putextra ("sms_body", "the SMS text ");
It. settype ("Vnd. Android-DIR/MMS-SMS ");
Startactivity (it );
7. 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 );
String body = "this is SMS 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 );
8. 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 );
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 );
9. Send email
Uri uri = URI. parse ("mailto: xxx@abc.com ");
Intent it = new intent (intent. action_sendto, Uri );
Startactivity (it );
Intent it = new intent (intent. action_send );
It. putextra (intent. extra_email, "me@abc.com ");
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 = {"me@abc.com "};
String [] CCS = {"you@abc.com "};
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 "));
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 "));
10. 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 );
11. Uninstall APK
Uri uri = URI. fromparts ("package", strpackagename, null );
Intent it = new intent (intent. action_delete, Uri );
Startactivity (it );
12. Install APK
Uri installuri = URI. fromparts ("package", "XXX", null );
Returnit = new intent (intent. action_package_added, installuri );
13. Open the camera
Intent I = new intent (intent. action_camera_button, null );
This. sendbroadcast (I );
Long datetaken = system. currenttimemillis ();
String name = createname (datetaken) + pai.jpg ";
Filename = folder + name;
Contentvalues values = new contentvalues ();
Values. Put (images. Media. Title, filename );
Values. Put ("_ Data", filename );
Values. Put (images. Media. picasa_id, filename );
Values. Put (images. Media. display_name, filename );
Values. Put (images. Media. Description, filename );
Values. Put (images. imagecolumns. bucket_display_name, filename );
Uri photouri = getcontentresolver (). insert (
Mediastore. Images. Media. external_content_uri, values );
Intent inttphoto = new intent (mediastore. action_image_capture );
Inttphoto. putextra (mediastore. extra_output, photouri );
Startactivityforresult (inttphoto, 10 );
14. Select an image from gallery
Intent I = new intent ();
I. settype ("image /*");
I. setaction (intent. action_get_content );
Startactivityforresult (I, 11 );
15. Enable the recorder
Intent MI = new intent (media. record_sound_action );
Startactivity (MI );
16. Open another program
Intent I = new intent ();
Componentname Cn = new componentname ("com. yellowbook. android2 ″,
"Com. yellowbook. android2.androidsearch ");
I. setcomponent (CN );
I. setaction ("android. Intent. Action. Main ");
Startactivityforresult (I, result_ OK );
17. Transfer attachments
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 "));
System action and Service Broadcast
String add_shortcut_action: Add a shortcut to the system .. "Android. Intent. Action. add_shortcut"
String all_apps_action: lists all available applications.
Input: none. "Android. Intent. Action. all_apps"
String alternative_category type: indicates that activity is an optional operation on the data you are browsing. "Android. Intent. Category. Alternative"
String answer_action: process the incoming call. "Android. Intent. Action. Answer"
String battery_changed_action broadcast: the charging status, or the battery power changes. "Android. Intent. Action. battery_changed"
String boot_completed_action broadcast: After the system is started.
This action is broadcast once (only once ). "Android. Intent. Action. boot_completed"
String browsable_category category: activities that can be safely used by browsers must support this category. "Android. Intent. Category. browsable"
String bug_report_action: displays the activity report error. "Android. Intent. Action. bug_report"
String call_action: Call.
The called contact is specified in the data. "Android. Intent. Action. Call"
String call_forwarding_state_changed_action broadcast: The call transfer status of the voice phone has changed. "Android. Intent. Action. CFF"
String clear_credentials_action: Clear the credential ). "Android. Intent. Action. clear_credentials"
String configuration_changed_action broadcast: The device configuration has changed. For more information, see resources. configuration. "android. Intent. Action. configuration_changed"
No creator, no www.2cto.com
String data_activity_state_changed_action broadcast: The data Activity Status of the phone (that is, the status of sending and receiving data) has changed. "Android. Intent. Action. data_activity"
String data_connection_state_changed_action broadcast: The telephone data connection status has changed. "Android. Intent. Action. data_state"
String date_changed_action broadcast: the date is changed. "Android. Intent. Action. date_changed"
String default_action: Same as view_action, It is a standard action performed on data. "Android. Intent. Action. View"
String default_category category: This category is required if activity is an option that saves data (click, Center Press. "Android. Intent. Category. Default"
String delete_action: deletes the specified data from the container. "Android. Intent. Action. Delete"
String development_preference_category category: indicates that activity is a development Panel. "android. Intent. Category. development_preference"
String dial_action: Call the specified phone number in the data. "Android. Intent. Action. Dial"
String edit_action: displays the Editable interface for the specified data. "Android. Intent. Action. Edit"
String embed_category type: It can be run in a parent activity. "Android. Intent. Category. Embed"
String emergency_dial_action: call an emergency phone number. "Android. Intent. Action. emergency_dial"
Int forward_result_launch start flag: If this flag is set.
An existing activity is used to start a new activity. The reply target of the existing activity is transferred to the new activity. 16 0x00000010
String fota_cancel_action broadcast: cancels all pending (pending) update downloads. "Android. server. checkin. fota_cancel"
String fota_install_action broadcast: The update has been confirmed and installation will begin immediately. "Android. server. checkin. fota_install"
String fota_ready_action broadcast: The update has been downloaded.
You can start installation. "Android. server. checkin. fota_ready"
String fota_restart_action broadcast: Resume stopped update downloads. "Android. server. checkin. fota_restart"
String fota_update_action broadcast: downloads and installs OS updates through Ota. "Android. server. checkin. fota_update"
String framework_instrumentation_test_category category: to be used as code under test for framework instrumentation tests. "android. Intent. Category. framework_instrumentation _ test"
String gadget_category category: this activity can be embedded in the host activity (activity that is hosting gadgets ). "Android. Intent. Category. Gadget"
String get_content_action: allows users to select data and return data. "Android. Intent. Action. get_content"
String home_category category: activity ).
The first activity displayed after the device is started. "Android. Intent. Category. Home"
String insert_action: insert an item in the container ). "Android. Intent. Action. Insert"
String intent_extra additional data: when used together with pick_activity_action, it indicates the activity selected for display; when used together with add_shortcut_action, it describes the shortcut to be added. "Android. Intent. Extra. intent"
String label_extra additional data: character tag starting with an upper-case letter, used together with add_shortcut_action. "Android. Intent. Extra. Label"
String launcher_category category: the activity should be displayed in the top-level launcher. "Android. Intent. Category. launcher"
String login_action: Obtain the logon credential. "Android. Intent. Action. login"
String main_action: It is started as the main entry point and does not require data. "Android. Intent. Action. Main"
String mediabutton_action broadcast: the user presses "Media button ". "Android. Intent. Action. mediabutton"
String media_bad_removal_action broadcast: the expansion media (expansion card) has been removed from the SD card slot, but the mount point has not been removed (unmount ). "Android. Intent. Action. media_bad_removal"
String media_eject_action broadcast: You want to remove the extension media (unplug the expansion card ). "Android. Intent. Action. media_eject"
String media_mounted_action broadcast: the extended media is inserted and mounted. "Android. Intent. Action. media_mounted"
String media_removed_action broadcast: the extended media is removed. "Android. Intent. Action. media_removed"
String media_scanner_finished_action broadcast: a directory of the media that has been scanned. "Android. Intent. Action. media_scanner_finished"
String media_scanner_started_action broadcast: starts scanning a directory of the media. "Android. Intent. Action. media_scanner_started"
String media_shared_action broadcast: the mounting of the extended media is unmounted ).
Because it has been shared as a USB large-capacity storage. "Android. Intent. Action. media_shared"
String media_unmounted_action broadcast: the extended media exists, but it has not been mounted ). "Android. Intent. Action. media_unmounted"
String message_waiting_state_changed_action broadcast: the message wait (Voice Mail) Status of the phone has changed. "Android. Intent. Action. MWI"
Int multiple_task_launch startup Tag: used together with new_task_launch.
You cannot change an existing task to a foreground task (foreground ). 8 0x00000008
String network_tickle_received_action broadcast: The device receives a new network "Tickle" notification. "Android. Intent. Action. network_tickle_received"
Int new_task_launch startup flag: After setting, the activity will become the first new task (top of the stack) in the history stack ). 4 0x00000004
Int no_history_launch start flag: After setting, new activity will not be saved in the history stack. 1 0 × 00000001
String package_added_action broadcast: An application package is installed on the device. "Android. Intent. Action. package_added"
String package_removed_action broadcast: An application package is deleted from the device. "Android. Intent. Action. package_removed"
String phone_state_changed_action broadcast: The phone status has changed. "Android. Intent. Action. phone_state"
String pick_action: select an item from the data to return the selected item. "Android. Intent. Action. Pick"
String pick_activity_action: select an activity and return the class (name) of the selected activity ). "Android. Intent. Action. pick_activity"
String preference_category category: activity is a set Panel (preference panel ). "Android. Intent. Category. Preference"
String provider_changed_action broadcast: The update will be (real) installed. "Android. Intent. Action. provider_changed"
String provisioning_check_action broadcast: requires the polling of provisioning service to download the latest settings. "Android. Intent. Action. provisioning_check"
String run_action action: run data (specified application), regardless of its (application. "Android. Intent. Action. Run"
String sample_code_category category: to be used as an sample code example (not part of the normal user experience). "android. Intent. Category. sample_code"
String screen_off_action broadcast: the screen is disabled. "Android. Intent. Action. screen_off"
String screen_on_action broadcast: the screen has been opened. "Android. Intent. Action. screen_on"
String selected_alternative_category category: for user-selected data.
Activity is an optional operation. "Android. Intent. Category. selected_alternative"
String sendto_action: send a message to the receiver specified by data. "Android. Intent. Action. sendto"
String service_state_changed_action broadcast: the status of the telephone service has changed. "Android. Intent. Action. service_state"
String settings_action: displays system settings. Input: none. "Android. Intent. Action. Settings"
String signal_strength_changed_action broadcast: The phone signal strength has changed. "Android. Intent. Action. sig_str"
Int single_top_launch start flag: After setting, if activity has been started.
At the top of the history stack, the activity will no longer be started (not restarted. 2 0x00000002
String statistics_report_action broadcast: receivers is required to report its own statistics. "Android. Intent. Action. statistics_report"
String statistics_state_changed_action broadcast: The statistics service status has changed. "Android. Intent. Action. statistics_state_changed"
String sync_action: Execute data synchronization. "Android. Intent. Action. Sync"
String tab_category category: this activity should be used as a tab in tabactivity. "Android. Intent. Category. tab"
String template_extra additional data: New Record initialization template. "Android. Intent. Extra. template"
String test_category category: used for testing, not part of a normal user experience. "Android. Intent. Category. test"
String timezone_changed_action broadcast: the time zone has changed. "Android. Intent. Action. timezone_changed"
String time_changed_action broadcast: the time has been changed (reset ). "Android. Intent. Action. time_set"
String time_tick_action broadcast: the current time has changed (normal time elapsed ). "Android. Intent. Action. time_tick"
String ums_connected_action broadcast: The device enters the USB high-capacity storage mode. "Android. Intent. Action. ums_connected"
String ums_disconnected_action broadcast: The device exits from the USB high-capacity storage mode. "Android. Intent. Action. ums_disconnected"
String unit_test_category category: it should be used as a unit test (run through test harness ). "Android. Intent. Category. unit_test"
String view_action action: displays data to the user. "Android. Intent. Action. View"
String wallpaper_category Type: this activity can set wallpaper for devices. "Android. Intent. Category. Wallpaper"
String wallpaper_changed_action broadcast: The system wallpaper has changed. "Android. Intent. Action. wallpaper_changed"
String wallpaper_settings_action: the page for selecting wallpaper is displayed. Input: none. "Android. Intent. Action. wallpaper_settings"
String web_search_action: executes a web search. "Android. Intent. Action. web_search"
String xmpp_connected_action broadcast: the XMPP connection has been established. "Android. Intent. Action. xmpp_connected"
String xmpp_disconnected_action broadcast: the XMPP connection has been disconnected. "Android. Intent. Action. xmpp_di