pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/piesocket/java-websocket-client

rigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-9e07ff8eaaaff3a3.css" /> GitHub - piesocket/java-websocket-client: Java WebSocket Client For Android and Java Projects · GitHub
Skip to content

piesocket/java-websocket-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java WebSockets Client For Android

PieSocket's Android SDK for WebSockets written in Java.

This SDK can be used to communicate with any third-party WebSocket server, and implements auto-reconnection among other best WebSocket practices.

Installation

Let's start by adding PieSocket Android SDK as a dependency to your application.

Gradle (Kotlin)

implementation("com.piesocket:channels-sdk:1.0.5")

Gradle (Java)

implementation 'com.piesocket:channels-sdk:1.0.5'

Maven

<dependency>
    <groupId>com.piesocket</groupId>
    <artifactId>channels-sdk</artifactId>
    <version>1.0.5</version>
</dependency>

Permissions

Setup manifest permissions as instructed here.

Usage

Stand-alone Usage

Create a Channel instance as shown below.

Channel channel = new Channel("wss://example.com", true);

channel.listen("system:connected", new PieSocketEventListener() {
  @Override
  public void handleEvent(PieSocketEvent event) {

    //WebSocket Connected
    channel.send("Hello");

  }
});

Use PieSocket's managed WebSocket server

Use following code to create a Channel with PieSocket's managed WebSocket servers.

Get your API key and Cluster ID here: Get API Key

PieSocketOptions options = new PieSocketOptions();
options.setClusterId("demo");
options.setApiKey("VCXCEuvhGcBDP7XhiJJUDvR1e1D3eiVjgZ9VRiaV");

PieSocket piesocket = new PieSocket(options);
Channel channel = piesocket.join("chat-room-1");

PieSocket Channels is a scalable WebSocket API service with following features:

  • Authentication
  • Private Channels
  • Presence Channels
  • Publish messages with REST API
  • Auto-scalability
  • Webhooks
  • Analytics
  • Authentication
  • Upto 60% cost savings

We highly recommend using PieSocket Channels over self hosted WebSocket servers for production applications.

Events

system:connected is the event fired when WebSocket connection is ready, get a full list system messages here: PieSocket System Messages

Documentation

For usage examples and more information, refer to: Official SDK docs

About

Java WebSocket Client For Android and Java Projects

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy