com.google.android.xmppService.IXmppService.createXmppSession: Creates a XMPP session to the server, using username and password for the login. createXmppSession starts a new XMPP session if there isn’t one for the username, connects to and logs into the GTalk server. If there is already a running XMPP session for the username, then createsXmppSession just returns the running session.
Why can’t username contain an @
?
From my testing, an @ seems to be required in the username, but it’s hard-coded to connect to Google talk.
If I just pass a gmail username it connects to a google talk server and sends <stream:stream to="username">, which causes the google talk server to return an error ‘unknown host’.
If I pass a gmail username@gmail.com it connects to a google talk server, sends <stream:stream to="gmail.com">, which works.
If I pass a username@jabber.org it connects to a google talk server, sends <stream:stream to="jabber.org">, and the google talk server returns an unknown host error.
Google’s jabber server is talk.google.com, while google JIDs are @gmail.com (presumably also @googlemail.com for the UK, and @company.com for gtalk for your domain), which means a raw JID isn’t enough to connect.
A Smack port wouldn’t be as useful as the XMPP service being fully open. Third party apps will use the system provided service, so you’d have to use a GTalk account for them.