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
690
アルプのロードマップ変遷 / 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
560
LWCでローカルコンポーネント開発 / Local development on LWC
kaelaela
1
1.1k
Clean ArchitectureとEffで変更に強いAPIを設計する
kaelaela
8
3.9k
こんなに違う!ScalaとKotlin
kaelaela
2
2.1k
Other Decks in Programming
See All in Programming
GoとPHPのインターフェイスの違い
shimabox
2
220
color-scheme: light dark; を完全に理解する
uhyo
7
510
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.6k
Amazon Bedrockマルチエージェントコラボレーションを諦めてLangGraphに入門してみた
akihisaikeda
1
160
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
260
はじめての Go * WASM * OCR
sgash708
1
120
Rails 1.0 のコードで学ぶ find_by* と method_missing の仕組み / Learn how find_by_* and method_missing work in Rails 1.0 code
maimux2x
1
260
The Clean ArchitectureがWebフロントエンドでしっくりこないのは何故か / Why The Clean Architecture does not fit with Web Frontend
twada
PRO
55
18k
Webフレームワークとともに利用するWeb components / JSConf.jp おかわり
spring_raining
1
140
Swift Testingのモチベを上げたい
stoticdev
2
200
Rubyと自由とAIと
yotii23
6
1.9k
読まないコードリーディング術
hisaju
0
120
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
68
4.6k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
Scaling GitHub
holman
459
140k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
Being A Developer After 40
akosma
89
590k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
134
33k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
GitHub's CSS Performance
jonrohan
1030
460k
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 ;-)