we have an application that need to interact with mail.
For that, our customer want us to :
- Retrieve the Activesync parameters the user have entered on the general parameters of the phone.
- Send the mail in a silent way using these activesync parameters.
- Be able to read and parse a possible reply to the mail on the Exchange server.
I know that it may cause severe security issue (retrieve a private password from an application is not a good practice..), but i can't find any clue on the sdk to communicate and send mail via activesync.
If anyone have some informations, i would be glad to hear about it.
Thanks a lot
Antoine
So, you want to send the email without any user intervention (in the background)?
Check out this article:
http://jondev.net/articles/Sending_Emails_without_User_Intervention_(no_Intents)_in_Android
Related
So I'm either going to get crucified for this or it'll be accepted as the honest, researched question it is...
How does one go about sending an email (with an image attachment) in Android (I'm using Kotlin but I'm fine with Java) without:
Intents - I don't want the user to see anything... It must just go in the background
GMail - Every single example/piece of code/tutorial I can find always talks about using GMail's SMTP... I don't want that. I want to input my own SMTP details so the email doesn't have to come from a GMail account and look rather unprofessional.
Yeah I've tried researching but as stated above, I keep finding the easy route (GMail). I'm relatively new to Android dev (years on iOS) so if there's an API or something I'm missing, please let me know :)
Thanks
Every single example/piece of code/tutorial I can find always talks about using GMail's SMTP... I don't want that. I want to input my own SMTP details so the email doesn't have to come from a GMail account and look rather unprofessional
Have your app contact your Web service, and have the Web service send the email on your behalf.
It's technically possible for you to use JavaMail and send SMTP directly from the client. This would require you to bake SMTP server information and user credentials into the app or to be able to download them from somewhere. Either will turn your SMTP server into a source of spam and related crap, as it will be easy for people to get at that information and use it to their own ends.
I am creating an app that has only a single hard coded email address that will receive and respond to questions with the response. Only the body of the email would be necessary. It is being sent back to the app in plain text to be read, bypassing the email client picker.
My question is this: Is this even possible to do? I've searched high and low for the solution to this about 3 months now and even Google doesn't know the answer to this one.
Is it possible to receive the contents of an email message
You are certainly welcome to write your own POP3 or IMAP4 client, as you could for just about any operating system. You are also certainly welcome to see if there are any fringe email clients for Android that offer an on-device API that offers access to email messages.
Otherwise, no.
When it comes to receiving an email, it doesn't seem like anyone knows anything about how to do that.
That is because there is nothing much Android-specific about email. Email is not part of the operating system. Email is something provided by apps.
My android application need to communicate with the gmail server to receive emails from other gmail accounts so that i can show the e-mails in my android application..
Can anybody suggest me a API or Docs or tutorial to accomplish this....
Thanks in advance.....
Regards,
HONY
You most probably want to interface with a IMAP or a POP mail server. Just lookup on Google. I'm sure that there are already libraries for Java (maybe also for Android) avaiable.
This SO question discuesses how to connect to a Gmail server in a desktop java application, but I think you can port it also to android.
I'm having trouble understanding the top level of abstraction of this problem.
The Problem:
Users A and B download application X. A wants to send application-specific data to B. How does user A link with B?
My incredibly messy solution:
- User A clicks a button on the application that opens up a list of contacts. user A selects user B from the list. User B's email address was stored in A's address book. Application creates a sort of "share ID" and sends it to user B via that email address. User B's application gets that ID from the mail, then User A and B use the share ID to connect to a server and share between each other via the sserver.
There must be a better way? The two problems are:
1. It shouldn't need a server (should it? could it be free?)
2. There must be better ways of the users connecting to each other than sending ID's or links etc by gmail.
This solution should be so so simple, but I can't get my head round it. If this question is not sufficient to get a good answer, please please tell me what I need to do to get into the way of thinking about how mobile users can interract with each other as simply as possible, with as few clicks as possible, (Mobile 2.0 or whatever the modern day thing is!)
For example: A mother and a child have an android smart phone. They each download the "ChildLeash" app. Child wishes to configure the app to send updates to Mother, so that Mother can keep track of Child's location and so on. The problem is some how Child needs to tell the app what location Mother is at for the data to be sent to. What is a user-friendly way for Child to Identify Mother's phone? (Mother's IP address? Phone number? Email address? OpenIDs? NFC/Bluetooth?) So that it can then communicate?
You could use push notifications, as provided by the Android Cloud to Device Messaging Framework. There's an Android blog post about this. Problem is, this seems beta and not yet available to all developers (you need a specific signup).
Regarding "IP Adresss", P2P and such, this generally won't work. See: Is peer-to-peer communication over 3G/4G possible for smart phones?
If messages are not urgent, then you could use AlarmManager to have your app wake up every hour or so, and check for new messages by connecting to a server. Not sure that would work for your "ChildLeash" example. Another similar solution would be to use a Service to poll the server.
Usually this sort of interaction would require a server. Which you've kind of faked using email as your medium.
It might be worth looking into peer to peer libraries such as JXTA. There's an android port here: http://code.google.com/p/peerdroid/
EDIT: I just came across this: http://android-developers.blogspot.com/2010/05/android-cloud-to-device-messaging.html Which looks like exactly what you're after.
I was wondering how to get the email from the owner of the phone or from the gmail account used on the phone.
I am trying to do this on android 1.6 and up.
I know its possible because I have seen some apps that get the email.
Maybe its undocumented or it reads it from a undocumented provider or some authentication service, but I know its possible.
Can anybody help me on this?
Thanks
Daniel
To retrieve information from another application you would use it's content provider.
The problem with what you want to do is that the gmail application is closed source and does not have documentation like the rest of the open source SDK. You could hack a solution together using undocumented providers like you said, but updates to the gmail application may break your code.
Either create your own email application using POP3 or IMAP and integrate with that, or think of a different way to do what you're looking to accomplish.