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
580
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WebSocket for Android ver.2
Yuichi Maekawa
September 16, 2016
More Decks by Yuichi Maekawa
See All by Yuichi Maekawa
Claude Code + Container Use と Cursor で作る ローカル並列開発環境のススメ / ccc local dev
kaelaela
16
9.7k
やらないことを決める
kaelaela
1
1.3k
ハイインテグリティコミットメントを実現するスクラム開発の進化 / Evolution of Scrum for High Integrity Commitment
kaelaela
1
960
アルプのロードマップ変遷 / Alp Roadmap History
kaelaela
0
3.1k
ApexでPofEAA / PofEAA by Apex
kaelaela
2
530
Zap Your DX!
kaelaela
1
620
Clasp使ってGASを快適に開発する / Let's play Clasp
kaelaela
0
690
LWCでローカルコンポーネント開発 / Local development on LWC
kaelaela
1
1.3k
Clean ArchitectureとEffで変更に強いAPIを設計する
kaelaela
8
4.2k
Other Decks in Programming
See All in Programming
act2-costs.pdf
sumedhbala
0
110
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
9.1k
関数型プログラミングのメリットって何だろう?
wanko_it
0
180
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
1.1k
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
490
コーディングルールの鮮度を保ちたい for SRE NEXT 2026 / keep-fresh-go-internal-conventions-sre-next-2026
handlename
0
140
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.9k
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
3
470
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
180
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
200
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
360
AIエージェントで 変わるAndroid開発環境
takahirom
2
650
Featured
See All Featured
Ruling the World: When Life Gets Gamed
codingconduct
0
280
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
300
Building an army of robots
kneath
306
46k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
220
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.3k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Become a Pro
speakerdeck
PRO
31
6k
Producing Creativity
orderedlist
PRO
348
40k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
What's in a price? How to price your products and services
michaelherold
247
13k
HDC tutorial
michielstock
2
740
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 ;-)