|
Title |
Provides intent actions | Provides intent URIs | Uses action | Uses URI | Description |
|---|---|---|---|---|---|
| Gmail |
Mail application connected to gmail server |
||||
| PeerDeviceNet | Send data to someone |
PeerDeviceNet is both app and middleware to connect android phones and tablets securely thru Wi-Fi network. As an app, it allows a group of devices share web pages, contact information, pictures, videos and other documentations. As middleware, it helps developing connected mobile apps. You can reuse PeerDeviceNet connection manager to connect mobile devices for connected mobile apps or multi-player games. Via PeerDeviceNet apps can send messages to peer devices using intents, messenger or idl interfaces. |


Comments
See the discussion on MIME
See the discussion on MIME types for mail.
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "email text");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
sendIntent.setType("message/rfc822");
startActivity(Intent.createChooser(sendIntent, "Title:"));
To send a file attachment
To send a file attachment from the SD card use the following code:
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("audio/mp3");
sendIntent.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
startActivity(Intent.createChooser(sendIntent, "Title:"));
setType should set the MIME type of the file being sent.
A list of commonly used extensions and corresponding MIME types is included in the OI File Manager mimetypes.xml.
PS: In your application, you can easily obtain the file name by calling the PICK FILE intent of the OI File Manager.
File attachment needs to passed as Uri
As mentioned in this Stack Overflow thread, files have to be attached as
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/mysong.mp3"));You need the extra / in file:/// (missing in the Stack Overflow post) as otherwise GMail drops the attachment just before sending stating the file path is wrong.
How to set the address
For the built-in MMS application, the following undocumented extras may be useful:
See current source code:
http://android.git.kernel.org/?p=platform/packages/apps/Mms.git;a=blob;f...
mExternalAddress = intent.getStringExtra("address");mExitOnSent = intent.getBooleanExtra("exit_on_sent", false);
mMsgText = intent.getStringExtra("sms_body");
String subject = intent.getStringExtra("subject");