how to extract to, subject etc fron email in android emulator? - java

I want to extract "To" and "Subject" from email clent which is already configured in android emulator.
so, is any api to extract or to get all email attributes?
Thanx in advance,

No, sorry.
Bear in mind that there is no single email client in Android. The Android open source project has one, but device manufacturers can (and do) replace it. Plus there is Gmail and other third-party mail clients (e.g., K9). Hence, there is no single email client "which is already configured in android". And the open source one is not part of the SDK, so there is nothing in the API for accessing it.

Related

Encrypting/hiding portions of the source code

I've made a simple mailing app that takes in email credentials and uses it to send emails of certain kinds to selected addresses. Problem is, I've had to input the credentials right into the code, so anyone who uses dex2jar can get the source code and get the email used for forwarding and easily make the app obsolete.
I imagine I'm not the only one facing this issue, so what are some ways to make my code secure?
No matter how good of a technique you use to hide the credentials, if it's in the code then it can always be found.
Instead of hard coding them in, you could perhaps let the user specify them when he starts the app? If that can't be avoided you could instead have a remote service that will do the sending and forward your request to that.
You can not both connect to an e-mail account and keep those same users out of said e-mail account. Consider using a hosted server as part of the project to securely connect to the e-mail account from the server level and process these e-mails remotely.

Can we fetch mails from inbuilt email app?

Is there any way fetch the mails from the inbuilt Email app that comes with the android device itself? Please note that I am not referring to the Gmail app. ??? If yes then please give a hint about it.
As per my research till now m not able to find any way to do this.
Thanks in advance....
This would only be possible for applications that expose this data via some form of API. The Email application that is part of the Android open source project has no documented or supported API of this type.

Javamail library, tracking specific emails

I am developing a Java app that reads all the emails from GMAIL and save them run time on objects of self made Class that holds some of the attributes of the email. Now I want to delete an email object and when I do that I want it to be removed from the internet as well. In order to do so I will need some information to query the GMAIL account to delete that particular email I am referring to. Is there a possible way to do that? Maybe by saving the header and then searching for that? I couldn't find a good way to do it.
I assume you are accessing GMAIL with IMAP. Then you could store the Message, call Message.setFlag(Flag.DELETED) then expunge the Folder, or search the Folder yourself. Or maybe you can search the Google Gmail api and find a better way. For example you can use the unique message ID
UPDATE this is a google project that can help you: java-gmail-imap. There is also a companion project for OAuth authentication (needed for run the sample)
I'd recommend you to take a look on James.
The Apache James Project delivers a rich set of open source modules and libraries, written in Java, related to Internet mail communication which build into an advanced enterprise mail server.
It depends on the time span between when you access the message and when you want to delete it. If it's short, and the folder is still open, you can just set the DELETED flag and close the folder to expunge the message.
But I'm assuming that you need to locate the message some time later. In that case, you should learn about IMAP UIDs. See the UIDFolder interface in JavaMail and the IMAP spec for details. In essence, you need to keep track of the folder's UIDVALIDITY value and the message's UID value. When you come back to the folder, you can make sure it's the same folder by checking the UIDVALIDITY value and then look up the message based on its UID.

Android: Get and Open Email

Is it possible to open an email in the standard email client that an android 2.2 phone comes with? I'd like to search emails and then open an email - of course with users permission.
But I can't find any docs and I can't think of any way to open an email by subject.
I would really appreciate any help! I have come across this but I can't find these classes in my android library.
Thanks all
Is it possible to open an email in the standard email client that an android 2.2 phone comes with?
There is no "standard email client that an android 2.2 phone comes with".
I am not aware of any email clients with documented and supported APIs, beyond ACTION_SEND. Certainly neither the AOSP Email application nor Gmail have documented and supported APIs.

Can an app send an email without opening the email interface in Android?

Can an app send an email without opening the email interface? How?
Simple Answer:
Its pretty easy to write an SMTP client yourself. See a sample here:
http://davanum.wordpress.com/2007/12/22/android-send-email-via-gmail-actually-via-smtp/
Elaborate Answer:
If you want to write a full featured mail client supporting SMTP, POP, IMAP etc then you should look at the android mail client source code:Email app source
I'm 98% sure that they only way you can do this is to write your own SMTP client and point it at a SMTP server you have a valid account on (or is open for relay). ie, you can't use the standard email app or gmail to do this.
My answer is probably a few months too late for you Mubix, but maybe someone else can benefit from it. I've seen many people refer to this tutorial which shows how to send an email when a button is clicked within your app.

Categories