0

I have an app that has some sounds, stored into raw folder of my project. For now it's only possible to reproduce it inside my app (by use MediaPlayer object). Now i would know if is possible to take this files, and share it via intent (for example by using whatsapp intent)

giozh
  • 9,868
  • 30
  • 102
  • 183

1 Answers1

0

You can copy the file to internal storage and use FileProvider to publish a Uri to the file that you can use with the ACTION_SEND Intent.

Or, you can try my StreamProvider to skip the copy-the-file part and publish a Uri straight from the raw resource.

Or, you can try using an android.resource Uri, but few apps support it for things like ACTION_SEND. Using either of the previous two approaches will give you better compatibility.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491