When doing Android training one inevitable question is "which intents can I use?".
I usually explain that there is more to it, that it depends on the devices capabilites etc. etc.... and that
if Google APIs are available on the device they can use this list:
http://developer.android.com/guide/appendix/g-app-intents.html ... and then I give them my own unofficial list.... and then I say 'go search stackoverflow', as the list of common intents is really way too short. In general the documentation about intents is about the general mechanisms, which is not what most developers needs to understand.
What I'd like to do is to modify the docs so
D) Merge 'Intent URI' and 'Intent Action' columns to simply show the code needed, like in the examples below
To A) I'd keep VIEW, WEB_SEARCH, CALL and DIAL and add intents for
* SMS
Intent i = new Intent(Intent.ACTION_VIEW);
i.setType("vnd.android-dir/mms-sms");
i.putExtra("sms_body", message);
i.putExtra("address", phone_number);
* Share intent
Intent i = new Intent(Intent.ACTION_SEND);
i.putExtra(Intent.EXTRA_SUBJECT, "blabla");
i.putExtra(Intent.EXTRA_TEXT, "blabla");
i.setType("text/plain");
* Email
Intent i = new Intent(Intent.ACTION_SEND);
i.putExtra(Intent.EXTRA_SUBJECT, subject);
i.putExtra(Intent.EXTRA_TEXT, text);
i.putExtra(Intent.EXTRA_EMAIL, new String[]{recipient});
i.setType("text/plain");
(with note: you’ll need to configure the email client. If the email client is not configured, it will not respond to the Intent)
* Pick contact
Intent i = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
* Pick image from gallery
Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);
* Capture image from camera
Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
I'd note that the list is for the AOSP phone implementation and that some might not be available on e.g. tablets.
To B) I'd remove common AOSP intents, keep the Google ones and
* add Google Play intent.
Before making the patch I'd like to get opinions and suggestions.
--
Jacob Nordfalk