[android-developers] Re: How do you create an MMS message with audio attachment?
Ok, digging into the com.android.mms.ui.ComposeMessageActivity "handleSendIntent()" method, it appears as though only Image attachments are expected in Intent Extras? Does anyone have any creative work-arounds of how to create/send an MMS message with an audio attachment? private void handleSendIntent(Intent intent) { Bundle extras = intent.getExtras(); if (Intent.ACTION_SEND.equals(intent.getAction()) && (extras ! = null) && extras.containsKey(Intent.EXTRA_STREAM)) { Uri uri = (Uri)extras.getParcelable(Intent.EXTRA_STREAM); if (uri != null) { convertMessage(true); addImage(uri); < IMAGE IS BEING ASSUMED } } } Will audio attachments via Intents be supported in the "cupcake" release? (I haven't downloaded it yet myself) Thanks, Blake On Dec 30 2008, 8:52 pm, "Blake B." wrote: > Hello all, > > I am trying to create an MMS message with an audio attachment and a > message for the user to view and then click "send" themselves. If you > create a new Message on your own, you are able to attach an audio file > (.amr in this case), but how do you do this programatically? > > When I do this code below, I get the MMS Compose Message window, but > it gives an error message: "Unsupported picture format. Please select > a different picture.": > > final Intent i = new Intent(Intent.ACTION_SEND); > i.putExtra("sms_body", msgText); > i.putExtra(Intent.EXTRA_STREAM, audioUri); > i.setType("*/*"); > startActivity(i); > > When I run this code below (changed MIME type from "*/*" to "audio/*" > or "audio/amr", Android instead brings up the GMail client with the > audio attachment on the email: > > final Intent i = new Intent(Intent.ACTION_SEND); > i.putExtra("sms_body", msgText); > i.putExtra(Intent.EXTRA_STREAM, audioUri); > i.setType("audio/*"); > startActivity(i); > > How can I direct the system to create an MMS message with a .amr > attachment? > > Thanks, > Blake --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How do you create an MMS message with audio attachment?
I'll ping the group one last time. Can anyone confirm that this is not possible? I looked at the latest com.android.mms.ui.ComposeMessageActivity in the main code branch now (I believe this includes the Cupcake updates), and it still appears the handleSendIntent() intent method is assuming that any EXTRA_STREAM data is an image, without checking the data MIME type. Any other ideas to maybe directly create an MMS message to send? It's hard for me to believe this is completely not possible to do in code. Thanks again, Blake On Jan 5, 8:50 am, "Blake B." wrote: > Ok, digging into the com.android.mms.ui.ComposeMessageActivity > "handleSendIntent()" method, it appears as though only Image > attachments are expected in Intent Extras? Does anyone have any > creative work-arounds of how to create/send an MMS message with an > audio attachment? > > private void handleSendIntent(Intent intent) { > Bundle extras = intent.getExtras(); > > if (Intent.ACTION_SEND.equals(intent.getAction()) && (extras ! > = null) && extras.containsKey(Intent.EXTRA_STREAM)) { > Uri uri = (Uri)extras.getParcelable(Intent.EXTRA_STREAM); > if (uri != null) { > convertMessage(true); > addImage(uri); < IMAGE IS > BEING ASSUMED > } > } > } > > Will audio attachments via Intents be supported in the "cupcake" > release? (I haven't downloaded it yet myself) > > Thanks, > Blake > > On Dec 30 2008, 8:52 pm, "Blake B." wrote: > > > Hello all, > > > I am trying to create an MMS message with an audio attachment and a > > message for the user to view and then click "send" themselves. If you > > create a new Message on your own, you are able to attach an audio file > > (.amr in this case), but how do you do this programatically? > > > When I do this code below, I get the MMS Compose Message window, but > > it gives an error message: "Unsupported picture format. Please select > > a different picture.": > > > final Intent i = new Intent(Intent.ACTION_SEND); > > i.putExtra("sms_body", msgText); > > i.putExtra(Intent.EXTRA_STREAM, audioUri); > > i.setType("*/*"); > > startActivity(i); > > > When I run this code below (changed MIME type from "*/*" to "audio/*" > > or "audio/amr", Android instead brings up the GMail client with the > > audio attachment on the email: > > > final Intent i = new Intent(Intent.ACTION_SEND); > > i.putExtra("sms_body", msgText); > > i.putExtra(Intent.EXTRA_STREAM, audioUri); > > i.setType("audio/*"); > > startActivity(i); > > > How can I direct the system to create an MMS message with a .amr > > attachment? > > > Thanks, > > Blake --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How do you create an MMS message with audio attachment?
I believe this was deliberately left out of the code for 1.0. I'm not aware of any plans to add it in Cupcake. I suggest you file a feature request. On Jan 7, 7:09 am, "Blake B." wrote: > I'll ping the group one last time. Can anyone confirm that this is > not possible? > > I looked at the latest com.android.mms.ui.ComposeMessageActivity in > the main code branch now (I believe this includes the Cupcake > updates), and it still appears the handleSendIntent() intent method is > assuming that any EXTRA_STREAM data is an image, without checking the > data MIME type. > > Any other ideas to maybe directly create an MMS message to send? It's > hard for me to believe this is completely not possible to do in code. > > Thanks again, > Blake > > On Jan 5, 8:50 am, "Blake B." wrote: > > > Ok, digging into the com.android.mms.ui.ComposeMessageActivity > > "handleSendIntent()" method, it appears as though only Image > > attachments are expected in Intent Extras? Does anyone have any > > creative work-arounds of how to create/send an MMS message with an > > audio attachment? > > > private void handleSendIntent(Intent intent) { > > Bundle extras = intent.getExtras(); > > > if (Intent.ACTION_SEND.equals(intent.getAction()) && (extras ! > > = null) && extras.containsKey(Intent.EXTRA_STREAM)) { > > Uri uri = (Uri)extras.getParcelable(Intent.EXTRA_STREAM); > > if (uri != null) { > > convertMessage(true); > > addImage(uri); < IMAGE IS > > BEING ASSUMED > > } > > } > > } > > > Will audio attachments via Intents be supported in the "cupcake" > > release? (I haven't downloaded it yet myself) > > > Thanks, > > Blake > > > On Dec 30 2008, 8:52 pm, "Blake B." wrote: > > > > Hello all, > > > > I am trying to create an MMS message with an audio attachment and a > > > message for the user to view and then click "send" themselves. If you > > > create a new Message on your own, you are able to attach an audio file > > > (.amr in this case), but how do you do this programatically? > > > > When I do this code below, I get the MMS Compose Message window, but > > > it gives an error message: "Unsupported picture format. Please select > > > a different picture.": > > > > final Intent i = new Intent(Intent.ACTION_SEND); > > > i.putExtra("sms_body", msgText); > > > i.putExtra(Intent.EXTRA_STREAM, audioUri); > > > i.setType("*/*"); > > > startActivity(i); > > > > When I run this code below (changed MIME type from "*/*" to "audio/*" > > > or "audio/amr", Android instead brings up the GMail client with the > > > audio attachment on the email: > > > > final Intent i = new Intent(Intent.ACTION_SEND); > > > i.putExtra("sms_body", msgText); > > > i.putExtra(Intent.EXTRA_STREAM, audioUri); > > > i.setType("audio/*"); > > > startActivity(i); > > > > How can I direct the system to create an MMS message with a .amr > > > attachment? > > > > Thanks, > > > Blake --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---