Import data from an e-mail account (Android Studio) - android

I am creating an app for android device and I was wondering if it is possible to connect my app with an e-mail account and have notifications every time the (let's say the gmail account) receives a new mail, and display the message in a new activity. I have researched a lot but I have not found something really useful.
Can anyone give me a clue on how to do it or even where to look for?

Yes. It is possible. You have to create an email client.
Here are some good email clients
You need to use the email client API for that. Here is Gmail API, you can find more my googling.

Related

Send email in Android WITHOUT intent or GMail SMTP

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.

Receiving mail in a IntentService

How to check for e-mails from an IntentService on an Android device?
Is there any library?
I googled a lot for this, but i can't find the solution.
There is no system API to check for email.
Email is handled by an individual app, which can be GMail, K-9 Mail, built-in email app etc.
None of them allow to read emails programmatically, because this would be a huge security hole.
The only two things you can do is to show 'New mail' dialog in Gmail with pre-filled text and address, and force account sync, which should force GMail to check for new mail immediately: Android how to enable/disable auto sync programmatically
Found out the solution: javaee.github.io/javamail/#JavaMail_for_Android

Receive emails via broadcast receiver

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.

Code to receive an email from gmail account in myandriod application

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.

how to get email from owner or from gmail account on android

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.

Categories

Resources