Retrieve pre-registered e-mail account information in android

Sreejith22
Sreejith22 used Ask the Experts™
on
Hello experts,

I would like to have a screen which displays all the pre-registered e-mail accounts in an android device.

If in my device, I have pre-registered account with, say, 3 service providers(Google, Yahoo, Rediff), the screen should show these three service providers name.

When I select a particular service provider, I should be prompted to enter the login credentials of the selected provider. If the credentials match the selected pre-registered acoount, a "Success" toast need to be displayed.

I just need the basic code to kick start this; ie; (i)the code to fetch the pre-registered service providers names and (ii) how the username / password gets verified when you enter the details.

Any help in this regard would be well appreciated with points for sure.

Looking forward for your valuable support.

Best Regards,
Sree
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Awarded 2011
Awarded 2011

Commented:


Frankly, don't know much about Android, but found this, don't know if you've seen this code;
perhpas it could help:
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/2.2_r1.1/com/android/email/activity/MessageList.java

Author

Commented:
Would love to have code snippet which will do the stuff for me.  The link you gave contains approximately 2000 lines of code in which I could not find what I was looking for. I guess, the crux of my requirement can be met with less than 10 lines of code.
Mick BarryJava Developer
Top Expert 2010

Commented:
you get that from the ServiceState
But that detail isn't available to you directly
Best you can do is have a listener that gets notified when state changes


public class ServiceStateListener extends PhoneStateListener{
   @Override
   public void onServiceStateChanged(ServiceState serviceState) {
       ...
   }
}


PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Author

Commented:
By service provider, I mean, e-mail Service provider and not GSM service providers.

So, in this context PhoneStateListener has no relevance I presume.

Anyway, thanks for your help.
Mick BarryJava Developer
Top Expert 2010

Commented:
sorry misread the question
I think what your after is the content providers, in your case Email Providers
http://developer.android.com/guide/topics/providers/content-providers.html
Solved myself

Author

Commented:
no help worked

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial