Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get main gmail account status

I am developing an Android application and I need to know status of the Google account used on the phone. I want to do this for the C2DM, but I don't want to ask the user to login again in his/her Google email account if they are already logged in. Is there any way to do it?

I already know hot to get the Google account..

Account[] accts = accountManager.getAccountsByType("com.google"); 
Account acct = accts[0]; 
System.out.println("Account:"+acct.name);

But how to check the status (logged_out, logging_in or logged_in)?

Thanks.

like image 717
user430926 Avatar asked Mar 03 '11 03:03

user430926


People also ask

How do I check my Gmail status?

Go to the listing for Gmail and look at the Current status column. A green button next to Gmail indicates there are no known issues, an orange button indicates a service disruption, and a red button indicates a service outage. Go to the current date for Gmail to read comments.

Who can see my Gmail status?

Only people you share a space with or someone you've accepted a chat invite from can see your status. Blocked users won't ever be able to see your status.

How do I know if my Google Account has been disabled?

What happens when your account is disabled. You can't sign in to Google services or use Sign in with Google. When you try to sign in, you'll get an error message or be sent to this page. In some cases, you'll get an email or text message from Google to tell you that your account is disabled.


1 Answers

I haven't been able to find a way to do exactly what you're looking for, but one simple solution would be to ask the user for their credentials when they first access the app (or this portion of the app) and then store them to use for future use. This way you can still check it without prompting them for their credentials and it won't matter what their current login state is.

like image 63
Wookie1120 Avatar answered Oct 31 '22 17:10

Wookie1120