I just went through the experience of running XMPP on Android, using the excellent Smack library. I take very little credit for getting it working, and just wanted to document my research in one place. The end result: XMPP running on Android SDK 1.5, using Smack 3.0.4 (svn revision 10869), including full support for bundled extensions. Note that at the time of writing, Smack 3.1.0 is available, but 3.0.4 was sufficient for my needs.
The first useful post I found was from Davanum Srinivas, found here. I had mixed results, and looked for a more source-level approach.
Reading through the comments, I found a link to Peter Neubauer's post here. The smackdiff file was exactly what I was looking for.
To apply the patch and build your own .jar, you'll need three tools installed: svn, diff, and ant. Looking at the .diff, the patch is against revision 10869 of the smack repository: http://svn.igniterealtime.org/svn/repos/smack/trunk. I checked out the source and applied the patch like this:
$ svn co -r 10869 \ http://svn.igniterealtime.org/svn/repos/smack/trunk smack-android $ cd smack-android/source $ patch -p0 -i /path/to/smack.diff $ cd ../build $ ant $ cd ../target
If all went well, you should see smack.jar and smackx.jar, and a few others. These .jar's should work on android, but there's one more catch. My application is using the MultiUserChat extension. The smack extensions are loaded based on a file in smack.jar's META-INF directory. So, when I build my .apk, I simply copied the contents of both smack.jar/META-INF and smackx.jar/META-INF into my apk's META-INF, and everything worked!
Note that one important function of the patch is to remove SSL from Smack, so SSL will not work on this build.
An issue I have not yet worked through is how to automatically import the files from this META-INF directory. I am using Maven to build my .apk (using maven-android-plugin) and have not yet found the best practice for copying these files, so if you have ideas, please post them.
Many thanks to Peter Neubauer and the Smack/Android teams for their work!