Do I need ProtoBuf RPC Android examples?

I am studying ProtoBufs and would like a good example of using it in Android and the presence of * .proto files (s) located on the server. I cannot find suitable tutorials for using RPC.

I would like class examples to show how to bind data (for example: http: /a-site.com/my-file.proto), and then deserialize / inflate data in a listView with binding. I don't need to serialize any data - just read and inflate it on the device.

Plz note that i'm currently learning web services; I really know how to create * .proto files - I just need to explore the Android side. Otherwise, I'm sure it would be easy for me to implement ProtoBuf.

Thank you so much for your help!

+4
source share
1 answer

The recently opened Google Sky Map Astronomy application for Android uses ProtoBuf to deserialize data in ProtobufAstronomicalSource :

http://code.google.com/p/stardroid/source/browse/trunk/app/src/com/google/android/stardroid/source/proto/

One touch of Android is that they use the "lite" version of the protobuf jar:

http://code.google.com/p/stardroid/source/browse/trunk/app/libs/protobuf-java-2.3.0-lite.jar

To do this, you need to add the LITE_RUNTIME flag to your .proto files - this will lead to the creation of Java proto classes that omit mobile-vm-friendly functions such as reflection.

By the way, protocol buffers themselves do not exactly provide full RPC (PB is just a way of encoding structured data), but, as you probably know, there are several third-party RPC implementations that are on top:

http://code.google.com/p/protobuf/wiki/ThirdPartyAddOns#RPC_Implementations

+2
source

Source: https://habr.com/ru/post/1389178/


All Articles