• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic