小编San*_*por的帖子

如何使用Scarlet在Android上通过WebSocket连接?

README.md中的代码

 val scarletInstance = Scarlet.Builder()
    .webSocketFactory(okHttpClient.newWebSocketFactory(GDAX_URL))
    .addMessageAdapterFactory(MoshiMessageAdapter.Factory())
    .addStreamAdapterFactory(RxJava2StreamAdapterFactory())
    .build() 
Run Code Online (Sandbox Code Playgroud)

版本和依赖项:

implementation 'com.tinder.scarlet:scarlet:0.1.8'
implementation "com.github.tinder.scarlet:scarlet-websocket-okhttp:0.1.7"
implementation "com.github.tinder.scarlet:scarlet-stream-adapter-rxjava2:0.2.4"
implementation "com.github.tinder.scarlet:scarlet-message-adapter-moshi:0.2.4"
implementation "com.github.tinder.scarlet:scarlet-lifecycle-android:0.2.4"
Run Code Online (Sandbox Code Playgroud)

sockets client android websocket kotlin

5
推荐指数
1
解决办法
735
查看次数

标签 统计

android ×1

client ×1

kotlin ×1

sockets ×1

websocket ×1