With the device path you can use:
final Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("audio/3gpp");
shareIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse("file://"+path+filename));
startActivity(Intent.createChooser(shareIntent, getString(R.string.share_sound)));
Function option for Whatsapp, for example:
public void onClick(View v) {
final Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
String audioClipFileName="audio.3gp";
shareIntent.setType("audio/3gpp");
shareIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse("file://"+"/sdcard/"+audioClipFileName));
shareIntent.setPackage("com.whatsapp");
startActivity(Intent.createChooser(shareIntent, "Compartilhando no whatsapp"));
}
IF YOUR PATH IS EXTERNAL. Remembering the Meuapp/Images folders should be created in the app installation:
Environment.getExternalStorageDirectory().getAbsolutePath() +
"/MeuApp/Imagens/";
For more details, click here.
The file is in the folder 'date/date/application/files/folder/file.3gp'. How do I put it in this Uri? Lollipop
– César Alves
UPDATED!......
– Lollipop