Android : using java socket.io client from Gottox in android app
===

Well, I am writing an android application and I want to use [Socket.IO-Client for Java][1] written by Gottox. The documentation in github specifically say the library is compatible with android.

Now my question is somewhat basic. **How to use that library in an android app?** 

So far I have tried two method.

 1. I built a jar file of that library using the commands (as explained
    in the library's doc)
    
        cd $PATH_TO_SOCKETIO_JAVA
        ant jar
        ls jar/socketio.jar
    
    I got a nice jar library in the folder. I added that jar to my
    project using
    
        RIGHT_CLICK->Properties->Java Build Path->Add External Jars
    
    Then I connected using
    
        SocketIO socket = new SocketIO("http://"+ip+":"+port+"/");
    
    I was able to compile and build my app without any errors. But when I run I got an exception on the line I have posted above.
    
        java.lang.NoClassDefFoundError: io.socket.SocketIO
         	at com.research.socketioresearch.LoginActivity.connectToSocketIO(LoginActivity.java:122)
         	at com.research.socketioresearch.LoginActivity$1.handleMessage(LoginActivity.java:113)
 
 2. As a second try, I created a java project using the socket.io
    library source code in my eclipse. Then I exported that project as a
    jar file using 
        
    
        RIGHT_CLICK->export->java->Jar File
    
    
    Then I added that jar file to my original android project using the
    same way I tried in method 1 (Add external jars). This time also I was able to
    compile and build, but getting the same exception at same line of
    code.

Now anyone has success in using the same library in android? How it is done?


  [1]: https://github.com/Gottox/socket.io-java-client
