Updated the sources to latest android version – Android 1.0 SDK, Release 2
Original article:
http://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp/
Updated screen shots:


Updated the sources to latest android version – Android 1.0 SDK, Release 2
Original article:
http://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp/
Updated screen shots:


RSS feed for comments on this post. TrackBack URI
[...] Updated XMPP Client for Android [...]
Pingback by Android - Just use Smack API for XMPP « Show me the code! - By Davanum Srinivas — December 29, 2008 @ 12:11 am
Any chance you could make a .apk available as well as a .zip so we can list your app on AndAppStore and allow Android users to download and install the app directly?
Comment by Al Sutton — December 29, 2008 @ 3:56 am
Very cool. Built on OS X after tweaking the ant script. I tested it in the emulator against an OpenFire server. Next I’ll try it on my G1. Thanks for this.
Comment by Mark Griffin — December 29, 2008 @ 9:47 pm
Since other people successfully built and ran this project, I am starting to think it is my setting. I kept seeing this error generated from Packet Reader in the log file:
java.security.KeyStoreException: KeyStore jks implementation not found
This origin is from Smack’s PacketReader and I read a post about installing the “cacerts” file as follows:
String javaHome = System.getProperty(“java.home”);
StringBuffer buffer = new StringBuffer();
buffer.append(javaHome).append(File.separator).append(“lib”);
buffer.append(File.separator).append(“security”);
buffer.append(File.separator).append(“cacerts”);
config.setTruststorePath(buffer.toString());
config.setTruststoreType(“jks”);
config.setTruststorePassword(“changeit”);
This didn’t seem to solve the problem on Windows. Can anyone provide any ideas how to proceed? If you actually use a patched version of Smack, could you either send me one copy or point me to where I can get one? I am doing a chess game between devices and honestly I am not quite sure if this is the right way to go.
Thanks a lot.
Comment by Chunyen Liu — December 30, 2008 @ 9:50 am
Chunyen, you may want to try the patch that was posted by peter here:
http://blog.jayway.com/2008/11/21/give-back-my-xmpp-in-android/
He does mention that it fixes the “especiallly the keystore problem on the device”
Comment by Davanum Srinivas — December 30, 2008 @ 10:17 am
Find interesting and usefull information
Comment by Ashly — January 3, 2009 @ 2:58 pm
I tried to use this app to connect to my own XMPP server, but I can’t. I don’t know why it couldn’t login. I could use another XMPP client program to login. this is the error
E/SOCKETLOG( 499): add_recv_stats recv 0
E/SOCKETLOG( 499): add_recv_stats recv 0
I/XMPPClient( 499): [SettingsDialog] Connected to 192.168.0.44
W/System.err( 499): stream:error (host-unknown)
W/System.err( 499): at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:306)
W/System.err( 499): at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)
W/System.err( 499): at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)
E/XMPPClient( 499): [SettingsDialog] Failed to log in as test@192.168.0.44
E/XMPPClient( 499): No response from the server.
Comment by Addion — January 4, 2009 @ 10:46 pm
I forgot to say thank-you to you. Indeed, Peter’s solution is what I was looking for. I compiled a patched version of Smack and started to paddle along with my chess software on Android.
Comment by Chunyen Liu — January 8, 2009 @ 10:27 am
Hi,
I am very new to Android world. I have downloaded XMPPClient-2.zip, extracted it and opened it in Eclipse 3.4.1 (Ganymede). I see following compilation errors in file, XMPPClient.java
———-
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.filter.MessageTypeFilter;
import org.jivesoftware.smack.filter.PacketFilter;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.util.StringUtils;
———
***Can not be resolved***
and in file SettingsDialog.java
——–
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.filter.MessageTypeFilter;
import org.jivesoftware.smack.filter.PacketFilter;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.util.StringUtils;
———
***Can not be resolved***
I understand that I had to some how make eclipse to know find above classe but I do not how to do that.
Could anyone help me out with this?
Thanks
Maddy
Comment by Maddy — January 13, 2009 @ 12:44 pm
Hi,
have you managed it? I try to do the same but since i am very new to it a few hints might be helpful.
Thanks and best, floda
Comment by floda — May 7, 2009 @ 1:22 pm
Hi,
Can anyone send me a patched smack.jar file that works with Android 1.0 SDK, please?
I thank you in advance.
Comment by Arjun — January 14, 2009 @ 11:48 am
Hi All,
I have dowloaded XMPPClient-2.zip file and I had build smack.jar file by taking Peter’s solution. I successfully build and run this application in Android emulator. After filling in all details in Setup (XMPP Settings) screen and pressing OK button causes application to close. The following error is displayed after pressing OK button,
—–
Sorry!
The application XMPP Demo (Process org.apache.android.xmpp) has stopped unexpectedly. Please try again.
—–
it comes with Force Close button and pressing on this closes the application.
Does anyone has any idea on this error?
Thanks
Arjun
Comment by Arjun — January 15, 2009 @ 10:47 am
Hi All,
I could finally got it working my making the patch for smack 3.1.0. If anyone want the patched smack please contact me on malli_730@yahoo.com, will send you by email.
Thanks
Maddy
Comment by Maddy — January 19, 2009 @ 5:27 am
[...] phone! i want a real jabber client for the g1 phone (general xmpp, maybe off smack?, sexier than this. ) who wants to [...]
Pingback by no longer a nokia fangirl « fabienne.us — February 6, 2009 @ 11:34 am
nice work, ran right from eclipse 1st try.
Comment by adrian — February 11, 2009 @ 3:53 pm
How do you use the patch listed on
http://blog.jayway.com/2008/11/21/give-back-my-xmpp-in-android/
I’m hoping this will solve my problems as currently the app crashes when I try to log in.
Comment by steve — February 23, 2009 @ 7:35 am
Hi all,
the PacketExtension, mentioned in the old thread, still don’t work.
Does no1 have a solution for this problem?
Greez,
Bull
Comment by Bulldog — February 27, 2009 @ 4:05 am
hi guys,
Does anyone implement file transfer feature? I have got any notification when the file comes in. But i can use JDK version smack api to achieve that. Do anyone know how to implement this feature use fixed smack.jar here? thank you
Comment by langjie — March 3, 2009 @ 12:52 pm
hi,
The error is:
The application XMPP Demo (Process org.apache.android.xmpp) has stopped unexpectedly. Please try again.
—–
it comes with Force Close button and pressing on this closes the application.
I want to known
which servers do you choose?gtalk or open fire
Thanks.
Comment by jacen — March 25, 2009 @ 2:51 am
Hello, I use Smack java library to send Instant messenger as you explain here. It works on the emulator but not on the G1 phone. Do you know why ?
Thank you for your help.
Comment by hellscarz — April 29, 2009 @ 11:25 am
Hello, I 34 vuse Smack java library to send Instant messenger as you explain here. It works on the emulator but not on the G1 phone. Do you know why ?
Thank you for45 your help.
Comment by dGologan — May 12, 2009 @ 3:43 am
Hello, I 34 vuse Smack java library to send Instant messenger as you explain here. It works on the emulator but not rt dgh tdh on the G1 phone. Do you know why ?
Thank you for45 your help.
Comment by dGologan — May 12, 2009 @ 3:43 am
hi,
this XMPP Client doesn’t work on sdk 1.5..
is there source of any xmpp client for sdk 1.5?
Comment by -=MccAt=- — May 30, 2009 @ 12:17 pm
Hi Davanum
same question as -=MccAt=-
Any answer??
Thanks Ben
Comment by Ben Pitman — June 9, 2009 @ 8:24 am
Hi.
For all of those who’ve got an exception at program start.
Try to add permission to use internet to the AndroidManifest.xml file.
Comment by lunatic — June 12, 2009 @ 8:29 am
Hi, and again:
Any news on XMPP and sdk 1.5??
Comment by Christian — June 19, 2009 @ 9:24 am
For those using an OpenFire server and getting the “stopped unexpectedly” error message on connect, try using the server’s IP address or hostname instead of “localhost” or “127.0.0.1″.
Also, for those having issues with 1.5, make sure you’re using the included /XMPPClient-2/XMPP/lib/smack.jar libraries and not the latest Smack libraries, which will probably give you errors in certificate authentication.
Comment by Dustin Ingram — June 19, 2009 @ 5:44 pm
Dear Dustin,
Thanks for your XMPPXClient2. I have successfully using it in message transferring.
In further,I am trying to transfer a file by my self. However, I’ve got the nullpointexception
in FileTransferNegotiator.setServiceEnabled(connection,true);
Do you have idea ? Or should I need the any path file for Smack.jar?
Thanks in advance.
Comment by skymedi Chen — June 29, 2009 @ 3:44 am
Hi Davanum
I have downloaded the source and can compile/run successfully on emulator/g1 with 1.5. It will be great if you can post which smack version you use and what changes you have made to it and how you have created the smack.jar file. I have downloaded the smack 3.1 and use the patch from jayway http://blog.jayway.com/2008/11/21/give-back-my-xmpp-in-android/ But there are still a few more errors needed to resolved. It would be great if you can post how you create the smack.jar file which is included in your source.
Comment by Win — July 3, 2009 @ 11:24 am
when I fill the parameters in dialog box (after clicking on setup button) as host name,port,service,userid & password as talk.google.com, 5222, gmail.com, my gmail id without & password respectively, after that when I click on OK button, after some time it displays “XMPPClient is not responding”, exception on emulator. I am using Android sdk 1.5
Please help me.
Thanks in advance.
Comment by Abhijit — September 22, 2009 @ 6:36 am
when I fill the parameters in dialog box (after clicking on setup button) as host name,port,service,userid & password as talk.google.com, 5222, gmail.com, my gmail id & password respectively, after that when I click on OK button, after some time it displays “XMPPClient is not responding”, exception on emulator. I am using Android sdk 1.5
Please help me.
Thanks in advance.
Comment by Abhijit — September 22, 2009 @ 6:37 am
I have successfully run XMPP-Client2 without any problem in my emulator, and use the latest SDK-1.6. However, since I have not an available GPhone, if anyone tell me, I wonder whether it doesnot work in real GPhone? Does anyone try it successfully in GPhone in same condition?
Comment by fangnster — September 29, 2009 @ 10:38 pm