I’m trying to pass an image from Android to WCF REST service as part fo JSON object.
My goal is to use most appropriate data types. So, on .NET side I was using byte[] to store data on receipt and on Java side I used byte[] as well.
First thing I got exception and it was because Java byte’s signed. So, I made my object sbyte[] on .NET side.
Is that really the best way? Or should I think about base64 and deal with serializing/deserializing on both ends? Right now JavaDeserializer takes care of it on .NET side and GSON takes care of it on Android side.
I think the best would be to transform your bytes to base64, the message size will be shorter and methods to transform from base64 to bytes and vice-versa are widely available on all platforms you use.