• 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
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

sending Email with attachment using Android emulator

 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an activity and it wishes to send a file(stored on SD card) as an email attachment.

So , I create an intent with Action = ACTION_SEND :



I populate the "To" and "Subject" fields using Intents "putExtra" methods:


I have the file that I need send as attachment in a FileInputStream, how do I attach it to email?
I think i can attach it using

Will this code work?

I tried running my code and when this logic was triggered an email editor was launched(No subject/ To fields were populated).
Is there a problem with emulator(specifically with its default email client?)

Thanks.



 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has any one tried sending an email on the emulator?
 
Author
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Has any one tried sending an email on the emulator?



At minimum, you will need an email application on the emulator (e.g., K9). The tests I have done with sending email were all done on a device, though.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply Mark..

Do you think i am treading the right path as regards sending email is concerned(can you please skim through the code in the first post)?
 
Mark L. Murphy
Author
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I haven't tried sending attachments. I think you're on the right track on the rest, though.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[I am reviving an old, unanswered thread...]

I need to send out emails and intercept them from my program(or atleast the program should be notified that an email is received).

I have tried sending emails from the emulator but without much luck(I have installed K-9 on my emulator) :|

Moreover, I am thinking of using EXTRA_STREAM to attach files too. Will this work on the real device?

What is the Android-action broadcast by the system when an email is recieved(assuming there is one)?

Thanks.
 
Author
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See this thread:

http://groups.google.com/group/android-developers/browse_thread/thread/65b4ec9ab8c57112
 
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