Android-Multiplayer-Tutorial
GRPC - Protocol Buffers - Multiplayer Architecture
Why GRPC:-
*Web infrastructure is already built on top of http
*Bi-directional streaming is easy
*Supports types and Validations
*Faster
Android app part:
- Create proto files – actions, data streams, models, actual service
- Generate the required Java files using Gradle plugin
- Get a stub from dagger using @Inject
- Call required method from stub asynchronously
- Handle response
Server part:
- Create proto files – actions, data streams, models, actual service
- Generate the required Java files using Gradle plugin
- Extend ActionServiceGrpc.ActionServiceImplBase interface
- Implement required methods
- Add interceptor (optional)
- Add server.crt, server.key (optional)
- Create MyServer.java and start server -> Woohoo!