Android enables mp3 player to play music.
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 program:
Uri uri = Uri. fromParts ("package", strPackageName, null );
Intent it = new Intent (Intent. ACTION_DELETE, uri );
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 SMS/MMS
Call the program for sending text messages
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 );
Call number:
Call the dialup Program
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 function, you must add <uses-permission id = "android. permission. CALL_PHONE"/> to the configuration file.
Display webpage:
Uri uri = Uri. parse ("http://www.google.com ");
Intent it = new Intent (Intent. ACTION_VIEW, uri );
StartActivity (it );
Display 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 % 20 startLng & daddr = endLat % 20 endLng & hl = en ");
Intent it = new Intent (Intent. ACTION_VIEW, URI );
StartActivity (it );
From Mingyue Tianya