附加音频文件作为android系统中一个MMS [英] Attached audio file as a mms in android
本文介绍了附加音频文件作为android系统中一个MMS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我开发一个应用程序需要记录voice.and那声音可自动连接到MMS。
I am develop one app that require record the voice.and that voice can be automatically attached to the mms.
我正在这期运用code
i am useing this code
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
sendIntent.putExtra("address", "9999999999");
sendIntent.putExtra("sms_body", "if you are sending text");
final File file1 = new File(Environment.getExternalStorageDirectory().getAbsolutePath(),"connection.amr");
Uri uri = Uri.fromFile(file1);
Log.e("Path", "" + uri);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("*/*");
startActivity(sendIntent);
所有关于这个打算不错,但文件不能附加automatically.any想法??
all of the going fine but file can't attached automatically.any idea about this??
在上发送按钮点击用户那个时候自动附加尤其是许多文件,主题和SMS_BODY一部分吧。
When user click on send button that time automatically attached that file in particular number with subject and sms_body part that it.
我的文件扩展名的名为.3gp
这code是三星王牌5830i和三星GALAXY Nexus完美的作品,但不是在HTC渴望C,HTC的工作之一。
我测试了这个setType.but没有正面回应。
I am tested this setType.but not positive response.
sendIntent.setType("video/3gp");
sendIntent.setType("audio/*");
sendIntent.setType("*/*");
sendIntent.setType("audio/mp3");
如果自动attachement是可以或不可以?
推荐答案
试试这个:
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("text-body", "if you are sending text");
sendIntent.putExtra("num", "number");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("ur file path"));
sendIntent.setType("audio/3gp");
这篇关于附加音频文件作为android系统中一个MMS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文