Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,741,079 Members 51,137 Now Online
XDA Developers Android and Mobile Development Forum

[LIBRARY] Background Mail Library

Tip us?
 
krvoZD
Old
(Last edited by krvoZD; 3rd January 2014 at 09:47 AM.)
#1  
krvoZD's Avatar
Junior Member - OP
Thanks Meter 10
Posts: 10
Join Date: Aug 2012
Location: Zadar

 
DONATE TO ME
Default [LIBRARY] Background Mail Library

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:
Select 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:
Select Code
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
This is optional

Code:
Select Code
bm.setSendingMessage("Loading...");
bm.setSendingMessageSuccess("Your message was sent successfully.");
bm.setProcessVisibility(false);
Last release

BackgroundMailLibrary 1.3

Change log:
Quote:
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
The Following 10 Users Say Thank You to krvoZD For This Useful Post: [ Click to Expand ]
 
DaGr81
Old
#2  
DaGr81's Avatar
Member
Thanks Meter 6
Posts: 59
Join Date: Aug 2010
Location: Kathmandu
what about sending email using gmail's intent but without showing gmail's interface?
HTC Google Nexus One
BlackRose HBOOT Version: 7.35.5017
Radio Version: 5.08.00.04
ClockworkMod Recovery Version: 5.0.2.0
ROM: CyanogenMod 7.2
Current Status: Broken Power Button but still rigid.


LG Google Nexus 4
Bootloader: MAKOZ30d
Baseband: .83
TWRP with MultiRom: 2.6.3
ROM: CyanogenMod 11


Asus Google Nexus 7
Bootloader Version: 4.13
TWRP version: 2.6.3
ROM: CyanogenMod 11
 
krvoZD
Old
#3  
krvoZD's Avatar
Junior Member - OP
Thanks Meter 10
Posts: 10
Join Date: Aug 2012
Location: Zadar

 
DONATE TO ME
Quote:
Originally Posted by DaGr81 View Post
what about sending email using gmail's intent but without showing gmail's interface?
not bad. I prefer this way.
 
~Black
Old
#4  
~Black's Avatar
Junior Member
Thanks Meter 2
Posts: 14
Join Date: Oct 2011
good job pal
 
taomorpheus
Old
#5  
taomorpheus's Avatar
Recognized Developer
Thanks Meter 2078
Posts: 930
Join Date: Nov 2011
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: [ Click to Expand ]
 
David 617
Old
#6  
David 617's Avatar
Senior Member
Thanks Meter 218
Posts: 514
Join Date: May 2011
Quote:
Originally Posted by DaGr81 View Post
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
 
tom4444
Old
#7  
tom4444's Avatar
Member
Thanks Meter 28
Posts: 41
Join Date: Sep 2013
Default Good!

Thank you, exactly what I've wanted!
 
njarun
Old
#8  
njarun's Avatar
Senior Member
Thanks Meter 45
Posts: 158
Join Date: Sep 2011
Location: Kottayam
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!
Need a light? I grow weed on my staff, too, if you like.
 
krvoZD
Old
#9  
krvoZD's Avatar
Junior Member - OP
Thanks Meter 10
Posts: 10
Join Date: Aug 2012
Location: Zadar

 
DONATE TO ME
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.
 
ArvinBoggs
Old
#10  
Junior Member
Thanks Meter 2
Posts: 18
Join Date: Nov 2013
thanx for sharing your library. but i still prefer to use intents. i guess to each his own.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...