Skip to content

Latest commit

 

History

History
14 lines (8 loc) · 861 Bytes

android_websocket.md

File metadata and controls

14 lines (8 loc) · 861 Bytes

okhttp的官方demo 看完后只能写出一个在websocket类中能发websocket,在别的Class中又调用不了,这样写代码没法复用reuse啊

我最后通过okhttp websocket callback这样的关键词组合找到了想要的搜索结果

Android.os.handler+interface

通过Android.os.handler+interface实现了传参"codeBlock"

也就是说把websocket的OnMessage回调消息处理,扔给使用ws工具类的class去解决

android websocket