Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8240977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:40:33+00:00 2026-06-07T20:40:33+00:00

Well, I am writing an android application and I want to use Socket.IO-Client for

  • 0

Well, I am writing an android application and I want to use Socket.IO-Client for Java 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 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:40:35+00:00Added an answer on June 7, 2026 at 8:40 pm

    Well I got it working myself..

    1. Use the first method I mentioned in the question, you will get a jar
      file in the path

      PATH_TO_SOCKETIO_JAVA/jar/socket.jar
      
    2. Now in your android project, create a folder called “libs” (if it is
      not already there)
    3. Copy that jar file to the ‘libs’ folder.
    4. Go to eclipse and refresh the android project.

    I am still not sure why adding jar file using “Add external Jars ” button in project properties is not working. Both add library to the project right?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an android application to make server socket and receive messages from
I am writing an Android application at the moment, no knowledge of java what
I'm writing a simple Android application that needs some text which should be written
I am writing a game on Android, and it is coming along well enough.
I am writing an application that needs to be supported on both android phones
Im writing a client/server app for android that sends a username and password to
I'm writing an android App which is basically finished and functions well on a
I'm writing an internal API for mobile device like iPhone or Android. I want
I am writing an Android application that does much of a processing in the
I am writing my first Android application, and I have been struggling with this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.