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
570
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
実はマルチモーダルだった。ブラウザの組み込みAI🧠でWebの未来を感じてみよう #jsfes #gemini
n0bisuke2
2
1.1k
ゲームの物理 剛体編
fadis
0
350
tparseでgo testの出力を見やすくする
utgwkk
2
220
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
420
MAP, Jigsaw, Code Golf 振り返り会 by 関東Kaggler会|Jigsaw 15th Solution
hasibirok0
0
240
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.8k
AIコードレビューがチームの"文脈"を 読めるようになるまで
marutaku
0
350
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
生成AIを利用するだけでなく、投資できる組織へ
pospome
2
340
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
410
AIコーディングエージェント(Gemini)
kondai24
0
220
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
130
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
9
510
Making Projects Easy
brettharned
120
6.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Facilitating Awesome Meetings
lara
57
6.7k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Faster Mobile Websites
deanohume
310
31k
Code Reviewing Like a Champion
maltzj
527
40k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.2k
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 ;-)