By user is "online", are you referring to gtalk chat status? If so, the term you are looking for is "presence API" and the technologies to search are XMPP and Jabber.
Do a quick
test of whether google announces presence to XMPP clients using an android XMPP app like
Xabber or a desktop app like pidgin (last time I used pidgin, it did support, but that was couple of years ago).
If they show presence of your contacts correctly, then it's confirmed that google supports presence notifications over XMPP.
You can then implement the same in your own app using some 3rd party XMPP library.