FORUMS

Floating Apps with Rovers – XDA App Review

There are a lot of great launchers to help customize your phone. Some Launchers allow … more

What Features Do You Look for in a Gallery App?

With so many different options to choose from, finding the right Gallery app may be a … more

Google Photos ‘Unlimited’ Storage Reportedly Being Capped

When Google Photos was announced, many of us thought very highly … more

Sprint Moves to Lift Video Streaming Limit for All-In

Yesterday, Sprint announced a new unlimited scheme that offered customers an … more

[LIBRARY] Background Mail Library

11 posts
Thanks Meter: 10
 
Post Reply Subscribe to Thread Email Thread
This is my first library, and also the first git upload.

Library is used for background sending mail from Gmail account.



Usage if very simple:

Code:
BackgroundMail bm = new BackgroundMail(context);
bm.setGmailUserName("yourgmail@gmail.com");
bm.setGmailPassword("yourgmailpassword");
bm.setMailTo("receiver@gmail.com");
bm.setFormSubject("Subject");
bm.setFormBody("Body");
bm.send();
...and you will need permissions

Code:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
This is optional

Code:
bm.setSendingMessage("Loading...");
bm.setSendingMessageSuccess("Your message was sent successfully.");
bm.setProcessVisibility(false);
bm.setAttachment(Environment.getExternalStorageDirectory().getPath()+File.pathSeparator+"somefile.txt");
Last release

BackgroundMailLibrary 1.5

Change log:
Quote:

Version 1.5
*fix #4

Version 1.4
*Added attachments support

Version 1.3
*Added password encryption for better security

Version 1.2
*Added process visibility feature

Version 1.1
*Added demo
*Bug fix

Version 1.0
*First upload

Here is link on Github

https://github.com/kristijandraca/BackgroundMailLibrary

Follow me

https://plus.google.com/u/0/+KristijanDrača
Last edited by krvoZD; 16th December 2014 at 01:50 PM. Reason: new version
The Following 10 Users Say Thank You to krvoZD For This Useful Post: [ View ]
 
 
10th December 2013, 04:36 PM |#2  
DaGr81's Avatar
Member
Flag Kathmandu
Thanks Meter: 21
 
More
Question
what about sending email using gmail's intent but without showing gmail's interface?
11th December 2013, 02:45 PM |#3  
krvoZD's Avatar
OP Junior Member
Flag Zadar
Thanks Meter: 10
 
Donate to Me
More
Quote:
Originally Posted by DaGr81

what about sending email using gmail's intent but without showing gmail's interface?

not bad. I prefer this way.
1st January 2014, 05:16 PM |#4  
~Black's Avatar
Junior Member
Thanks Meter: 2
 
More
good job pal
1st January 2014, 06:07 PM |#5  
taomorpheus's Avatar
Recognized Developer
Thanks Meter: 2,427
 
More
Hi, nice idea, but if the user has to input the password, I find the intent safer and much more trusted.
The Following User Says Thank You to taomorpheus For This Useful Post: [ View ]
1st January 2014, 06:30 PM |#6  
David 617's Avatar
Senior Member
Thanks Meter: 259
 
More
Quote:
Originally Posted by DaGr81

what about sending email using gmail's intent but without showing gmail's interface?

Is this even possible?

Sent from my Galaxy Nexus using Tapatalk
1st January 2014, 07:28 PM |#7  
tom4444's Avatar
Member
Thanks Meter: 28
 
More
Good!
Thank you, exactly what I've wanted!
2nd January 2014, 04:34 AM |#8  
njarun's Avatar
Senior Member
Kottayam
Thanks Meter: 45
 
More
So you need to enter the username and password for it right?

This is already done and show some references or credits, people deserve it. Link i found in the stackoverflow some months before - LINK

Also using this library or this method the chances of play store app suspension is very HIGH. and Im one of the developer who faced it. My app was sending mails from background with users request. It collected username and password (but never manipulated). And ended up in app suspension!!

Now i use GMAIL AUTH for sending mails from background. And this is the preferred method since it never collect the users ID and Password. The user will be prompted to login the gmail in a web interface and if he authorize your app, the app can send mails from background without user intervention then... as simple as that, and a safe and secure way!
3rd January 2014, 09:42 AM |#9  
krvoZD's Avatar
OP Junior Member
Flag Zadar
Thanks Meter: 10
 
Donate to Me
More
Thank you all for your interest in this project. I'm not saying it's perfect safety, feel free to add your code. I have added password encryption in the new version.
6th January 2014, 02:30 AM |#10  
Junior Member
Thanks Meter: 2
 
More
thanx for sharing your library. but i still prefer to use intents. i guess to each his own.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes