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.3k
やらないことを決める
kaelaela
1
1.1k
ハイインテグリティコミットメントを実現するスクラム開発の進化 / Evolution of Scrum for High Integrity Commitment
kaelaela
1
810
アルプのロードマップ変遷 / Alp Roadmap History
kaelaela
0
2.8k
ApexでPofEAA / PofEAA by Apex
kaelaela
2
480
Zap Your DX!
kaelaela
1
560
Clasp使ってGASを快適に開発する / Let's play Clasp
kaelaela
0
600
LWCでローカルコンポーネント開発 / Local development on LWC
kaelaela
1
1.2k
Clean ArchitectureとEffで変更に強いAPIを設計する
kaelaela
8
4k
Other Decks in Programming
See All in Programming
可変性を制する設計: 構造と振る舞いから考える概念モデリングとその実装
a_suenami
10
1.7k
대규모 트래픽을 처리하는 프론트 개발자의 전략
maryang
0
120
Nuances on Kubernetes - RubyConf Taiwan 2025
envek
0
130
MCP連携で加速するAI駆動開発/mcp integration accelerates ai-driven-development
bpstudy
0
290
AIコーディングエージェント全社導入とセキュリティ対策
hikaruegashira
16
9.6k
『リコリス・リコイル』に学ぶ!! 〜キャリア戦略における計画的偶発性理論と変わる勇気の重要性〜
wanko_it
1
400
Comparing decimals in Swift Testing
417_72ki
0
170
Amazon Q CLI開発で学んだAIコーディングツールの使い方
licux
3
180
Google I/O Extended Incheon 2025 ~ What's new in Android development tools
pluu
1
250
JetBrainsのAI機能の紹介 #jjug
yusuke
0
190
#QiitaBash TDDで(自分の)開発がどう変わったか
ryosukedtomita
1
360
リッチエディターを安全に開発・運用するために
unachang113
1
360
Featured
See All Featured
Docker and Python
trallard
45
3.5k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.3k
Fireside Chat
paigeccino
38
3.6k
4 Signs Your Business is Dying
shpigford
184
22k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
440
Code Reviewing Like a Champion
maltzj
524
40k
Statistics for Hackers
jakevdp
799
220k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Mobile First: as difficult as doing things right
swwweet
223
9.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
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 ;-)