I m new in Android. I am trying to send an MMS with audio file, with m4a format (or other, like AMR, or 3GP). To do this I use an intent but it never sends my MMS. Here isfolowing code I am using:
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("audio/m4a");
share.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + new Environment.getExternalStorageDirectory().getPath()+"/recordaudio.m4a")));
startActivity(share);
And my audio flie does not reach more than 30kb. Could you help me please ? Sorry for the english I'm French
File audiofile = new File(directory,"/recordaudio.m4a");
byte fileContent[] = new byte[(int) audiofile.length()];
InputStream input = new FileInputStream(audiofile);
int data = input.read();
while(data != -1) {
data = input.read(fileContent);
}
input.close();
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_PHONE_NUMBER, mPhoneNumber);
sendIntent.setType("audio/*");
sendIntent.putExtra(Intent.EXTRA_STREAM, fileContent);
startActivity(sendIntent);*
First of all , thank you very much for your help !!!! I tried this code and mms is not send... Could you help me again ??