Fork me on GitHub

Compatibility

Client version Socket.IO server
0.9.x 1.x
1.x 2.x (or 3.1.x / 4.x with allowEIO3: true)
2.x 3.x / 4.x

Installation

The latest artifact is available on Maven Central.

Maven

Add the following dependency to your pom.xml.

<dependencies>
  <dependency>
    <groupId>io.socket</groupId>
    <artifactId>socket.io-client</artifactId>
    <version>2.1.1</version>
  </dependency>
</dependencies>

Gradle

Add it as a gradle dependency for Android Studio, in build.gradle:

implementation ('io.socket:socket.io-client:2.1.1') {
  // excluding org.json which is provided by Android
  exclude group: 'org.json', module: 'json'
}

Dependency tree

socket.io-client engine.io-client okhttp
2.1.1 (diff) 2.1.0 3.12.12
2.1.0 (diff) 2.1.0 (diff) 3.12.12
2.0.1 (diff) 2.0.0 3.12.12
2.0.0 (diff) 2.0.0 (diff) 3.12.12
1.0.2 (diff) 1.0.2 (diff) 3.12.12
1.0.1 (diff) 1.0.1 (diff) 3.12.12 (changelog)
1.0.0 1.0.0 3.8.1