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
gRPC for Android
Search
Daichi Furiya (Wasabeef)
August 08, 2015
Programming
6
7k
gRPC for Android
introduction to gRPC for Android
Daichi Furiya (Wasabeef)
August 08, 2015
Tweet
Share
More Decks by Daichi Furiya (Wasabeef)
See All by Daichi Furiya (Wasabeef)
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
1.3k
About Flutter Architecture
wasabeef
1
190
2023 Flutter/Dart Summary
wasabeef
0
54
I/O Extended 2023 - Dart と Flutter の新機能
wasabeef
0
160
I/O Extended 2023 - Flutter 活用事例
wasabeef
10
2.8k
What it Takes to be a Flutter Developer
wasabeef
0
180
FlutterKaigi 2022 Keynote
wasabeef
1
570
Flutter Hooks を使ったアプリ開発 / App Development with the Flutter Hooks
wasabeef
2
1.3k
Flutter 2021 の振り返りと今後のアプリ開発に向けて / Looking back on Flutter 2021 and for future app development.
wasabeef
4
2.1k
Other Decks in Programming
See All in Programming
社内フレームワークとその依存性解決 / in-house framework and its dependency management
vvakame
1
550
動作確認やテストで漏れがちな観点3選
starfish719
6
1k
ファインディの テックブログ爆誕までの軌跡
starfish719
2
1.1k
お前もAI鬼にならないか?👹Bolt & Cursor & Supabase & Vercelで人間をやめるぞ、ジョジョー!👺
taishiyade
5
3.8k
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
3
4.1k
CloudNativePGがCNCF Sandboxプロジェクトになったぞ! 〜CloudNativePGの仕組みの紹介〜
nnaka2992
0
220
ASP. NET CoreにおけるWebAPIの最新情報
tomokusaba
0
360
時計仕掛けのCompose
mkeeda
1
280
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
1
140
Spring gRPC について / About Spring gRPC
mackey0225
0
220
Honoをフロントエンドで使う 3つのやり方
yusukebe
5
2.2k
『GO』アプリ バックエンドサーバのコスト削減
mot_techtalk
0
130
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Building Adaptive Systems
keathley
40
2.4k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
RailsConf 2023
tenderlove
29
1k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
99
18k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Transcript
H31$GPS"OESPJE !XBTBCFFG@KQ
"CPVU.F @wasabeef_jp CyberAgent, Inc.
8IBUJTH31$
)551
)551 • Binary • Multiplexed • Server Push • Header
compression
-BOHVBHFT
-BOHVBHFT • C/C++ • C# • Java • Go •
Objective-c • Node.js • PHP • Python • Ruby
8IBUJT 1SPUPDPM#VFST
1SPUPDPM#VFST • IDL • Binary • Support code generation (protoc)
VTFSKTPO { id: 1, name: “wasabeef”, createdAt: “20150808” }
VTFSQSPUP syntax = "proto3"; package user; message Profile { string
id = 1; string name = 2; int64 createdAt = 3; }
QSPUPCVG
*OTUBMM # git clone
[email protected]
:google/protobuf.git # cd protobuf # git
checkout v3.0.0-alpha-3.1 # ./autogen.sh # ./configure # make # make check # sudo make install
*OTUBMM # protoc --version libprotoc 3.0.0
3FUSPU
$POWFSUFS
$POWFSUFST • GSON • Jackson • Moshi • Protobuf •
Simplexml • Wire
1SPUP$POWFSUFS Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://api.example.com") .converter(new ProtoConverter()) .build();
0UIFST • Wire (Square) • FlatBuffers (Google) • Message Pack
(Sadayuki Furuhashi)
6TFH31$
FDIPQSPUP syntax = "proto3"; option java_package = “jp.wasabeef.proto.echo”; option go_package
= "echo"; package echo; message EchoRequest { string message = 1; } message EchoReply { string message = 1; } service Echo { rpc Echo (EchoRequest) returns (EchoReply) {} }
$PEFHFOFSBUJPO • protobuf-gradle-plugin • (protoc) • (protoc-gen-grpc-java)
HSQDKBWB
%FQFOEFODJFT compile 'io.grpc:grpc-all:x.y.z'
TBNQMF AsyncSubject<String> subject = AsyncSubject.create(); new Thread(() -> { Channel
channel = OkHttpChannelBuilder.forAddress(“grpc.wasabeef.jp”, 8443) .setConnectionSpec(ConnectionSpec.MODERN_TLS) .sslSocketFactory((SSLSocketFactory)SSLSocketFactory.getDefault()) .build(); EchoGrpc.EchoBlockingStub stub = EchoGrpc.newBlockingStub(channel); Echo.EchoRequest req = new Echo.EchoRequest(); req.setMessage(“YES YES YES!"); Echo.EchoReply reply = stub.echo(req); subject.onNext(reply.getMessage()); subject.onCompleted(); }).start(); subject.observeOn(AndroidSchedulers.mainThread()).subscribe(msg -> { Log.d(“ECHO LOG” ,msg); });
HSQDDPNNPO
%PDVNFOUT https://github.com/grpc/grpc-common
UIBOLT