I would like to attach a .ics file (icalendar file) to an MMS message, but the android messaging application seem restricted to media attachments only. The MMS application opens with everything in order (To and body fields) but there is no trace of the attachment, as if it had been completely ignored.
I am using android intents, the code is the following:
String uri = "file:///mnt/sdcard/meeting.ics";
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("address", toMMS);
sendIntent.setType("text/calendar");
sendIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
sendIntent.putExtra("sms_body", "You've been invited to a new meeting");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(uri));
this.startActivity(sendIntent);
I also tried without success, chaging the MIME type:
sendIntent.setType("text/*");
or
sendIntent.setType("text/plain");
I tested all the above cases with a plain txt file, but there is still no attachment. The standard MMS android application doesn't seem to accept non-media file attachments.
I also tried to completely remove the setType line, but then the message application crashes when started.
So, does anybody know how to attach a non-media file to an MMS message? Or if it is impossible?
My phone is: Google Nexus S Android version 2.3.4
Thanks in advance.
PD: the same issue was asked here, but without answer: Sending an MMS with a vCard attachment on Android devices