Welcome to the New XDA-Developers Portal!

You may recall that a few weeks ago, we opened up the XDA-2015 forum themesto intrepid users … more

An Android Enthusiast’s Apple iPhone 6 Challenge

The media has gone batty again over Apple “revolutionizing” smartphones. … more

Sony to Extend its AOSP Program to Other Devices

Sony will be offering its users the possibility to use AOSP ROMs as an alternative to the … more

Project Ara: Modified Android L and Hot Swapping

Project Ara is a very exciting topic–both for hardware and software enthusiasts. The … more
Post Reply

[LIBRARY] Background Mail Library

10th December 2013, 01:09 PM   |  #1  
krvoZD's Avatar
OP Junior Member
Flag Zadar
Thanks Meter: 10
 
10 posts
Join Date:Joined: Aug 2012
Donate to Me
More
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"/>
This is optional

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
Last edited by krvoZD; 3rd January 2014 at 09:47 AM.
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: 7
 
67 posts
Join Date:Joined: Aug 2010
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
 
10 posts
Join Date:Joined: Aug 2012
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
 
14 posts
Join Date:Joined: Oct 2011
good job pal
1st January 2014, 06:07 PM   |  #5  
taomorpheus's Avatar
Recognized Developer
Thanks Meter: 2,252
 
985 posts
Join Date:Joined: 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: [ View ]
1st January 2014, 06:30 PM   |  #6  
David 617's Avatar
Senior Member
Thanks Meter: 237
 
558 posts
Join Date:Joined: May 2011
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
 
42 posts
Join Date:Joined: Sep 2013
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
 
158 posts
Join Date:Joined: Sep 2011
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
 
10 posts
Join Date:Joined: Aug 2012
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
 
18 posts
Join Date:Joined: Nov 2013
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


Top Threads in IDEs, Libraries, & Programming Tools by ThreadRank