Android Protobuf Tutorial with example app

Looking for something that’s potentially better than JSON? Check out Google’s Protocol Buffers (aka. Protobuf).

There’re already loads of article about it compare to JSON e.g.

So here, I’m not going to talk about what it is or how it is compared to JSON. Instead I will share with you a working example code how to create an Android app that reads Protobuf data from a web service.

How it works?

Before showing the code, perhaps let me explain how the entire code system works within the Android Studio environment. It is illustrated in the diagram below.

--

--