1

I am planning an application in which the server side will be written in C# and the client side will be created using phonegap

The application makes heavy use of Binary Files serialized using the protobuf-net libs.

Say i have an object in C#

public class Foo
{
   private string FooProp;
}

and this object is serialized and transferred to the client using phonegap. Is it even possble to deserialize the resultant binary file in phone gap and access these properties in phonegap using Javascript?

Paul Plato
  • 1,471
  • 6
  • 28
  • 36

1 Answers1

5

The first sentence of the Protocol Buffers documentation is:

Welcome to the developer documentation for protocol buffers – a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more.

Hence, yes, protobuf is platform independent.

As to whether you can use protobuf from JavaScript, I will point you to this question, as the overall answer seems to be "only via a third-party library". You will also find some third-party libraries for this on the protobuf project site.

Community
  • 1
  • 1
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • If i deserialize the FOO Class in javascript. Do i get a Foo object in Json or is there some other representation for deserialized data? – Paul Plato Sep 06 '13 at 17:23
  • @PeterEdike: You will have to ask the author of whatever JavaScript library you decide to use. – CommonsWare Sep 06 '13 at 17:24