Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

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
 
I'm all tasted up for a BLT! This tiny ad wants a monte cristo!
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic