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
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.3k
やらないことを決める
kaelaela
1
1.2k
ハイインテグリティコミットメントを実現するスクラム開発の進化 / Evolution of Scrum for High Integrity Commitment
kaelaela
1
890
アルプのロードマップ変遷 / Alp Roadmap History
kaelaela
0
2.9k
ApexでPofEAA / PofEAA by Apex
kaelaela
2
500
Zap Your DX!
kaelaela
1
590
Clasp使ってGASを快適に開発する / Let's play Clasp
kaelaela
0
650
LWCでローカルコンポーネント開発 / Local development on LWC
kaelaela
1
1.3k
Clean ArchitectureとEffで変更に強いAPIを設計する
kaelaela
8
4.1k
Other Decks in Programming
See All in Programming
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
370
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.8k
今から始めるClaude Code超入門
448jp
7
8.3k
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
990
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
420
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
100
CSC307 Lecture 07
javiergs
PRO
0
550
AI時代の認知負荷との向き合い方
optfit
0
140
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
CSC307 Lecture 09
javiergs
PRO
1
830
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
140
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
64
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
So, you think you're a good person
axbom
PRO
2
1.9k
New Earth Scene 8
popppiees
1
1.5k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
48
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
160
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
920
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
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 ;-)