Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
WebSocket for Android ver.2
Search
Yuichi Maekawa
September 16, 2016
Programming
1
560
WebSocket for Android ver.2
Yuichi Maekawa
September 16, 2016
Tweet
Share
More Decks by Yuichi Maekawa
See All by Yuichi Maekawa
Claude Code + Container Use と Cursor で作る ローカル並列開発環境のススメ / ccc local dev
kaelaela
16
8.7k
やらないことを決める
kaelaela
1
1.2k
ハイインテグリティコミットメントを実現するスクラム開発の進化 / Evolution of Scrum for High Integrity Commitment
kaelaela
1
820
アルプのロードマップ変遷 / Alp Roadmap History
kaelaela
0
2.8k
ApexでPofEAA / PofEAA by Apex
kaelaela
2
480
Zap Your DX!
kaelaela
1
570
Clasp使ってGASを快適に開発する / Let's play Clasp
kaelaela
0
610
LWCでローカルコンポーネント開発 / Local development on LWC
kaelaela
1
1.2k
Clean ArchitectureとEffで変更に強いAPIを設計する
kaelaela
8
4k
Other Decks in Programming
See All in Programming
旅行プランAIエージェント開発の裏側
ippo012
2
920
複雑なドメインに挑む.pdf
yukisakai1225
5
1.2k
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
10
4.4k
Navigating Dependency Injection with Metro
zacsweers
3
2.5k
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
530
アセットのコンパイルについて
ojun9
0
130
Reading Rails 1.0 Source Code
okuramasafumi
0
250
Improving my own Ruby thereafter
sisshiki1969
1
160
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
870
@Environment(\.keyPath)那么好我不允许你们不知道! / atEnvironment keyPath is so good and you should know it!
lovee
0
120
個人軟體時代
ethanhuang13
0
330
OSS開発者という働き方
andpad
5
1.7k
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
3
58
Building Applications with DynamoDB
mza
96
6.6k
Designing for humans not robots
tammielis
253
25k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
530
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
113
20k
Navigating Team Friction
lara
189
15k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
RailsConf 2023
tenderlove
30
1.2k
It's Worth the Effort
3n
187
28k
Transcript
WebSocket For Android ver.2 @kaelaela(Yuichi Maekawa) 鳥: kaelaela31 蛸猫: kaelaela
ver.1 https://speakerdeck.com/kaelaela/websocket-for-android on Aug 23, 2016 @ Wantedly
The next day
> BROADCAST DESTROY < #REF! -> Broadcast Destroy: http://konifar-zatsu.hatenadiary.jp/entry/2016/07/27/020130
But
This entry’s target is enterprise services.
Sounds logical. I agree to you only if enterprise services.
For normal mobile app • Almost all services have no
proxy • Need real time update!(messaging app or game) • Need low energy consumption! > If you make long polling system, the user say “Battery fire!” and put 1 star...
Use WebSocket in peace ;-)
Do you know okhttp-ws?
Sample code • My sample Android project https://github.com/kaelaela/WebSockcetSample
okhttp-ws
Update of okhttp-ws • Add to main repos on v3.5.0!!(SNAPSHOT
now) PR: #2852 https://github.com/square/okhttp/pull/2852 compile 'com.squareup.okhttp3:okhttp-ws:3.4.1' compile 'com.squareup.okhttp3:okhttp:3.5.0'
Update of okhttp-ws • Remove ws package • Add method
to OkHttpClient okhttp3.ws.* -> okhttp3.* newWebSocketCall
Sample code diff • 3.4.1 -> 3.5.0 https://github.com/kaelaela/WebSockcetSample/commit/45b88ad2ecc5a89dbd493 fc3cc25152511e28529
Echo test: websocket.org
Echo test: websocket.org Supports TLS.
Retrofit? -> No change. It will be added in v2.2!!!
(No due date. 31% complete at 2016-09-16.) • Issue #924 • Commit interface Service { @GET("/chat/{id}") Call<WebSocket> chat(@Path("id") String id); }
Let’s replace your http client with okhttp! If your project
use okhttp.
Thx ;-)