Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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.8k
やらないことを決める
kaelaela
1
1.3k
ハイインテグリティコミットメントを実現するスクラム開発の進化 / Evolution of Scrum for High Integrity Commitment
kaelaela
1
1k
アルプのロードマップ変遷 / Alp Roadmap History
kaelaela
0
3.1k
ApexでPofEAA / PofEAA by Apex
kaelaela
2
530
Zap Your DX!
kaelaela
1
630
Clasp使ってGASを快適に開発する / Let's play Clasp
kaelaela
0
710
LWCでローカルコンポーネント開発 / Local development on LWC
kaelaela
1
1.3k
Clean ArchitectureとEffで変更に強いAPIを設計する
kaelaela
8
4.3k
Other Decks in Programming
See All in Programming
SREの越境 / SRE Collaboration
y0hgi
2
310
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
490
mrbgem 三角測量 開発
ogom
0
240
Domain-Driven Transformation
hschwentner
2
2.3k
Jetpack Compose Mechanisms
skydoves
3
790
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.9k
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
160
wkhtmltopdfの次どうするか問題2026
willnet
2
1.9k
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
880
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
4.9k
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
Featured
See All Featured
Discover your Explorer Soul
emna__ayadi
2
1.3k
Technical Leadership for Architectural Decision Making
baasie
3
600
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
360
Build your cross-platform service in a week with App Engine
jlugia
234
19k
A Tale of Four Properties
chriscoyier
163
24k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
The Curious Case for Waylosing
cassininazir
1
570
First, design no harm
axbom
PRO
2
1.3k
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 ;-)