0

I am developing an app which sends may be like 400kb of data in the interval of every 5seconds ,i have read somewhere that we can conpress the data in php using gz but how to measure the compression and how to deconpress it in java /android .

  • Maybe you are referring to compressing the whole http response. If you're server is apache you need to have mod deflate enabled. In the `AddOutputFilterByType` directive append `application/json` or whatever content-type header you're retrieving. If you have nginx server google on how to enable compression for it. On the other hand on android you don't need to do nothing extra if you are using apache's HttpClient to make the requests. – Bogdan Constantinescu Jan 11 '15 at 14:52
  • But how to uncompress it in android – abhimanyud3dx Jan 12 '15 at 06:24
  • One of the things is that you must set the `Accept-Encoding` header on requests to indicate support for the `gzip` and `deflate` compression schemes. It depends on your client you are using, it might be set automatically and decompression can be done automatically by it. Check for the client you are using how to uncompress the response from server. For example for apache's HttpClient you must use `HttpClientBuilder`...check [this](http://stackoverflow.com/questions/2777076/does-apache-commons-httpclient-support-gzip) answer. – Bogdan Constantinescu Jan 12 '15 at 07:45

0 Answers0