Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Attaching file which is stored in to the application's directory

 
Hardik Trivedi
Ranch Hand
Posts: 252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I want to attach one audio file to android in-built email client application. TO call that intent I am using


The audio file is stored into applications at path.

I am storing this file using file descriptor. I have also used .

In android's email client it shows option of attachment. But it allows to browse gallery only.

Please help.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the "it" in "it allows to browse gallery only"? If you want to use the email client's attachment feature for arbitrary files stored on your device then you need to install an application that allows you to browse all files - something like OI File Manager, or any of a number of file managers available.

If, on the other hand, you're trying to attach the file to the intent you're creating, then something like this should work:

emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///data/data/<packagename>/files/<filename>"))

The type should be "message/rfc822" for sending email, though.
 
Hardik Trivedi
Ranch Hand
Posts: 252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///data/data/<packagename>/files/<filename>"))


I tried this also. It works .It sends mail with the attachment but it displayes file size 0kb.
I am triying to attach the audio file.

I have done so far is ..



I know I just a leap away from my desired output.

Help please
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic