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
7.2k
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
6
2.2k
About Flutter Architecture
wasabeef
1
280
2023 Flutter/Dart Summary
wasabeef
0
93
I/O Extended 2023 - Dart と Flutter の新機能
wasabeef
0
200
I/O Extended 2023 - Flutter 活用事例
wasabeef
10
3k
What it Takes to be a Flutter Developer
wasabeef
0
210
FlutterKaigi 2022 Keynote
wasabeef
1
640
Flutter Hooks を使ったアプリ開発 / App Development with the Flutter Hooks
wasabeef
2
1.5k
Flutter 2021 の振り返りと今後のアプリ開発に向けて / Looking back on Flutter 2021 and for future app development.
wasabeef
4
2.2k
Other Decks in Programming
See All in Programming
モダンJSフレームワークのビルドプロセス 〜なぜReactは503行、Svelteは12行なのか〜
fuuki12
0
130
Querying Design System デザインシステムの意思決定を支える構造検索
ikumatadokoro
1
1.2k
分散DBって何者なんだ... Spannerから学ぶRDBとの違い
iwashi623
0
140
r2-image-worker
yusukebe
1
180
AIを駆使して新しい技術を効率的に理解する方法
nogu66
1
670
Building AI with AI
inesmontani
PRO
1
320
How Software Deployment tools have changed in the past 20 years
geshan
0
18k
海外登壇の心構え - コワクナイヨ - / how to prepare for a presentation abroad
kishida
2
110
「正規表現をつくる」をつくる / make "make regex"
makenowjust
1
950
データファイルをAWSのDWHサービスに格納する / 20251115jawsug-tochigi
kasacchiful
2
100
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
260
オフライン対応!Flutterアプリに全文検索エンジンを実装する @FlutterKaigi2025
itsmedreamwalker
2
320
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
GraphQLとの向き合い方2022年版
quramy
49
14k
Faster Mobile Websites
deanohume
310
31k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Into the Great Unknown - MozCon
thekraken
40
2.2k
Code Review Best Practice
trishagee
72
19k
Building Applications with DynamoDB
mza
96
6.8k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
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