Git Product home page Git Product logo

websocketservice's Introduction

WebSocketService

Android WebSocket Service实现

如果你困扰怎么在Android上使用WebSocket,此项目是你很好的研究对象

Demo可用作WebSocket测试工具

基于okhttp3

这是一个LocalService,并不支持运行在独立进程中

用法

导入此项目自己阅读app模块的代码

功能

  1. 这个Demo可以直接作为WebSocket测试工具使用
  2. 字符串数据内容即时收发
  3. 二进制数据内容即时收发
  4. 轻松的获取连接状态
  5. 可选的后台持续运行功能
  6. 自动重连

数据传递

Service与其它安卓组件进行数据交换不是一件很方便的事情

此项目使用 https://github.com/Attect/StaticViewModelStore 来实现在同一进程的App内,任意Activity/Fragment/Service及其它LifecycleOwner中进行数据的收发和控制这个Service

演示

https://www.bilibili.com/video/av51729765/

websocketservice's People

Contributors

attect avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.