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
550
WebSocket for Android ver.2
Yuichi Maekawa
September 16, 2016
Tweet
Share
More Decks by Yuichi Maekawa
See All by Yuichi Maekawa
やらないことを決める
kaelaela
1
1k
ハイインテグリティコミットメントを実現するスクラム開発の進化 / Evolution of Scrum for High Integrity Commitment
kaelaela
1
650
アルプのロードマップ変遷 / Alp Roadmap History
kaelaela
0
2.6k
ApexでPofEAA / PofEAA by Apex
kaelaela
2
440
Zap Your DX!
kaelaela
1
520
Clasp使ってGASを快適に開発する / Let's play Clasp
kaelaela
0
550
LWCでローカルコンポーネント開発 / Local development on LWC
kaelaela
1
1k
Clean ArchitectureとEffで変更に強いAPIを設計する
kaelaela
8
3.8k
こんなに違う!ScalaとKotlin
kaelaela
2
2k
Other Decks in Programming
See All in Programming
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
10
1.4k
ErdMap: Thinking about a map for Rails applications
makicamel
1
1.1k
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
8
1.3k
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
3
3.2k
ESLintプラグインを使用してCDKのセオリーを適用する
yamanashi_ren01
2
380
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
200
自動で //nolint を挿入する取り組み / Gopher's Gathering
utgwkk
1
170
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
28
6.1k
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
300
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
230
Внедряем бюджетирование, или Как сделать хорошо?
lamodatech
0
980
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
1
200
Featured
See All Featured
The Invisible Side of Design
smashingmag
299
50k
YesSQL, Process and Tooling at Scale
rocio
171
14k
Into the Great Unknown - MozCon
thekraken
34
1.6k
Docker and Python
trallard
43
3.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
GitHub's CSS Performance
jonrohan
1030
460k
Site-Speed That Sticks
csswizardry
3
310
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Optimizing for Happiness
mojombo
376
70k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Code Reviewing Like a Champion
maltzj
521
39k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
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 ;-)