How to Create a XMPP Chat Client in Android with Openfire? -
How to Create a XMPP Chat Client in Android with Openfire? -
i newbie android. wanted create xmpp chat client along force notifications. have installed openfire , server ready testing on local machine.
at point doing 1. creating xmpp connection in async task 2. onpost creating chat manager
protected void onpostexecute(final boolean success) { if (success) { if (connection != null) { chatmanager = connection.getchatmanager(); chat newchat = chatmanager.createchat("shobhit", new messagelistener() { public void processmessage(chat chat, message message) { //do } }); } } }
but totally confused if doing correctly. read somewhere on stackoverflow async should used little duration activities , connection can timed out here.
i found these probable solutions: runnable, handlers create service broadcast receivers
i not sure method should opt. can guys suggest optimum method , pointers illustration of great?
thanks chetan
as said, async should used little duration activities. assuming utilize version of asmack in android, connection has in separate thread activity (as networking process) have utilize new thread/runnable connection xmpp server. asmack utilize own threads after that, shouldn't worry it. template, can create simple application may killed anytime android. if want resist long-time, should utilize service xmpp part
android xmpp openfire smack
Comments
Post a Comment