Link to home
Start Free TrialLog in
Avatar of Sreejith22
Sreejith22Flag for India

asked on

Retrieve pre-registered e-mail account information in android

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
Avatar of for_yan
for_yan
Flag of United States of America image



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
Avatar of Sreejith22

ASKER

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.
Avatar of Mick Barry
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) {
       ...
   }
}


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.
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
ASKER CERTIFIED SOLUTION
Avatar of Sreejith22
Sreejith22
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
no help worked