Once you get tired of the limitations of android's built-in IMProvider and the corresponding API - IXmppSession and IXmppService, try the sample below. Inside the source/binary zip (bottom of this article) you will find a smack.jar that works with android. To build the jar yourself, You can download the Smack 3.0.4 sources from here and apply the patch here.
Coding Library:
Java/JSP
More Google Android Resources:

