I am trying to create an XMPP client via the Smack library for my android app. The goal is to use GCM-XMPP in my implementation of chatting functionality in my app. From what i've been reading I could use Smack classes such as ChatManager, Chat and Message to create chats between users and also to add chat message listeners. On the other hand, i see that i can do the same i did with the ChatManager, Chat and Message classes using packets in order to create stanzas. From what I understand from GCM documentation, these stanzas will be needed to verify ACK and NACK messages between my app server and GCM CCS servers. Please correct me if I am wrong. It seems to me that creating these packets/stanzas will be more useful once i implement GCM functionality in my chat app.
Also, I still dont understand the role of OpenFire. I have OpenFire installed in my Localhost for testing purposes. To me it seems more like an interface where I can debug chat errors created by the Smack classes. Should this OpenFire be opened in my computer while I test my app chat functionality. I've downloaded OpenFire already and it created the necessary tables in my localhost database.
There's also some code that I am trouble understanding its parameters:
XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder();
configBuilder.setUsernameAndPassword("username", "password");
configBuilder.setResource("SomeResource");
configBuilder.setServiceName("jabber.org");
AbstractXMPPConnection connection = new XMPPTCPConnection(configBuilder.build());
connection.connect();
connection.login();
In the above code, what should be "username" and "password". Should it be the username and password used to log in to my localhost, or a username and password I am using to identify myself as a chatter in my app? What about .setServiceName("jabber.org")? Should I set 10.0.2.2 in here since I am using localhost tested via android emulator? Should I type OpenFire? And when this happens: connection.connect() , where is this connection connecting to? OpenFire or Localhost? Where is it login into?
Any advice will be appreciated