Protocol Buffer is not a new data format introduced by Google. I shared about it in 2017, as a way of transferring data payloads other than REST JSON format that we are all familiar with.
In the recent introduction of Jetpack DataStore, a replacement for Android popularly known SharedPreferences, Protocol Buffer is now introduced as a means to store more comprehensive data. The two articles n Android Developer Documentation below mentioned it.
This essentially makes it important for Android Developer to know what is Protocol Buffer.
The documentation above, does point to the Protocol Buffers tutorial. However, I can’t find any guide on how to set that up on Android Studio to generate the Protocol Buffer file.
Hence I’m sharing here to make it easier to follow along when one needs it. But before that….
What is Protocol Buffer (aka Protobuf)?
This is a Google Introduce data model format, that can be used to generate different programming serialization code
The Protocol Buffers tutorial will provide a guide on how to do so separately from mobile development.
From there, one can imagine, iOS developers can use the Swift Proto Model to read and share the same Proto Data File/Stream that is used by its respective Android development.
One benefit of using this file format is, if we follow the rule strictly, it is relatively forward and backward compatible. Hence, this might be the reason Google now advocates Protobuf as the file format for its Jetpack DataStore.
Full Article: Elye @ Mobile App Development Publication
Mobile App Development Best Practices – 04.10
iOS New and Deprecated APIs in iOS 17 Abstract Class vs. Protocol-Oriented Approach in Swift Comparing the Performance of the...
New and Deprecated APIs in iOS 17
In this video, I would like to share with you some things that were either deprecated or added in iOS...
Promova helps people with dyslexia learn languages
The new Promova feature comes just in time for National Dyslexia Awareness Month and is available on the platform for...
Notify – A simple note application with modern MVVM, Compose and Material3
Notify is a simple note application that is built with Modern Android development tools. This project showcases the Good implementation...
Mobile App Development Best Practices – 03.10
iOS MetaCodable – Supercharge Swift’s Codable implementations with macros meta-programming How to build a Tuist plugin and publish it using...
How to make and use BOM (Bill of Materials) dependencies in Android projects
By using a BOM dependency, you can avoid specifying the versions of each individual library in your app, and let...