Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
9.2k
やらないことを決める
kaelaela
1
1.2k
ハイインテグリティコミットメントを実現するスクラム開発の進化 / Evolution of Scrum for High Integrity Commitment
kaelaela
1
860
アルプのロードマップ変遷 / Alp Roadmap History
kaelaela
0
2.9k
ApexでPofEAA / PofEAA by Apex
kaelaela
2
490
Zap Your DX!
kaelaela
1
580
Clasp使ってGASを快適に開発する / Let's play Clasp
kaelaela
0
640
LWCでローカルコンポーネント開発 / Local development on LWC
kaelaela
1
1.2k
Clean ArchitectureとEffで変更に強いAPIを設計する
kaelaela
8
4.1k
Other Decks in Programming
See All in Programming
All(?) About Point Sets
hole
0
280
Herb to ReActionView: A New Foundation for the View Layer @ San Francisco Ruby Conference 2025
marcoroth
0
240
AIコードレビューがチームの"文脈"を 読めるようになるまで
marutaku
0
310
開発に寄りそう自動テストの実現
goyoki
1
460
関数実行の裏側では何が起きているのか?
minop1205
1
600
AIコーディングエージェント(Gemini)
kondai24
0
160
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
28
16k
20 years of Symfony, what's next?
fabpot
2
310
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
480
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
270
Building AI Agents with TypeScript #TSKaigiHokuriku
izumin5210
6
1.2k
Microservices Platforms: When Team Topologies Meets Microservices Patterns
cer
PRO
1
930
Featured
See All Featured
For a Future-Friendly Web
brad_frost
180
10k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Practical Orchestrator
shlominoach
190
11k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
120
20k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Code Review Best Practice
trishagee
73
19k
Optimizing for Happiness
mojombo
379
70k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
We Have a Design System, Now What?
morganepeng
54
7.9k
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 ;-)