• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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: 43027
76
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic