Search code examples
androidfile-format

minimize upload and download speed for application


I have android inventory app. At this moment app is communicating with server via https. I have already gzip enabled and it is working. When users scan barcode, app is sending that code and also phone ID to server. I do it via XML. Then servers responds with xml witch contains some data. Like amount in each warehouse is, price, product name. Then user confirms amount and app is sending again to servers and responds with message (ok, or not ok).

When inventory is via WiFi, that's not a problem speed is good, latency low. But when inventory is via mobile network, then communication is with latency. Do i need to create binary format for communication? And XML data has large overhead (unneeded data like tags, etc). Or there is some standards or best practices with data amount minimization in communications ?


Solution

  • If you are primarily concerned about reducing the size of your payload, you definitely want to look at a different format from XML. One popular option is protobuf from Google.