One, SMS sharing
01
Intent Intent = new Intent (intent.action_send);
02
Intent.settype ("Text/plain"); Plain text
03
Picture sharing
04
Intent.settype ("Image/png");
05
Add a picture
06
File F = new file ("/sdcard/sd.png");
07
Uri u = uri.fromfile (f);
08
Intent.putextra (Intent.extra_stream, u); Add a picture
09
Intent.putextra (Intent.extra_subject, "share");
10
Intent.putextra (Intent.extra_text, "I would like to share");
11
StartActivity (Intent.createchooser (Intent, GetTitle ()));
Second, mail sharing
01
Intent log = new Intent ("Android.intent.action.SEND");
02
object[] ArrayOfObject2 = new Object[3];
03
Arrayofobject2[0] = "Nick";
04
ARRAYOFOBJECT2[1] = ":";
05
ARRAYOFOBJECT2[2] = "content";
06
String str1 = String.Format ("@%s%s%s", arrayOfObject2);
07
String str2 = str1 + "what";
08
object[] ArrayOfObject1 = new Object[1];
09
Arrayofobject1[0] = str2;
10
Log.putextra ("Android.intent.extra.TEXT", GetString (R.string.mail_body_text, ArrayOfObject1));
11
Log.putextra ("Android.intent.extra.SUBJECT", "Mail");
12
Log.settype ("Application/octet-stream");
13
StartActivity (log);
Android Information Sharing implementation