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
590
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
Transcript
20 slides
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 ;-)
More Decks by Yuichi Maekawa
See All by Yuichi Maekawa
Claude Code + Container Use と Cursor で作る ローカル並列開発環境のススメ / ccc local dev
kaelaela
16
9.9k
やらないことを決める
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
540
Zap Your DX!
kaelaela
1
640
Clasp使ってGASを快適に開発する / Let's play Clasp
kaelaela
0
720
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
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
310
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
16
9k
Crash Auto Pipelines
veronikapj
1
410
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
3
1.5k
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
210
SODA - FACT BOOK(EN)
sodainc
1
230
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
350
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
330
SODA - FACT BOOK(JP)
sodainc
1
40k
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
2k
AI-Powered Domain-Driven Design
ziobrando
0
430
Performance Optimization With LLMs
xleitix
0
250
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
56
10k
Crafting Experiences
bethany
1
430
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.8k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
460
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.7k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.7k
ラッコキーワード サービス紹介資料
rakko
5
5.8M
A designer walks into a library…
pauljervisheath
211
25k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k