本文介绍了Android的:如何发送语音彩信附件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经通过这个code做了录音:
I have already done a voice recording by this code:
recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(Environment
.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
+"test.3gp");
try {
recorder.prepare();
} catch (IOException io) {
Toast.makeText(getApplicationContext(), "Record File", Toast.LENGTH_LONG).show();
}
recorder.start();
和尝试使用共享像这样的共享意图:
and trying to share it using a share intent like this:
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("video/3gp");
sharingIntent.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/Downloadtest.3gp");
startActivity(Intent.createChooser(sharingIntent, "Share via"));
但是当我的邮箱是设置它通过电子邮件发送,但我想分享VAIA彩信?它被attatched彩信?怎么办呢?
but when my mail is setup it send via email, but i want to share it vaia mms? its being attatched in mms? how to do it?
推荐答案
您可以在我的情况下,尝试这个它的工作完美。
You can try this in my case it work perfect.
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(),"Downloadtest.3gp");
Uri uri = Uri.fromFile(file1);
Log.e("Path", "" + uri);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("video/3gp");
startActivity(sendIntent);
但有些设备不能接受像HTC渴望,HTC之一,lava.In你的情况下,工作完美再贴上code。
But some device can't accept like Htc Desire,Htc one,lava.In Your case work perfect then paste code.
这篇关于Android的:如何发送语音彩信附件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!