【问题标题】:android httprequest compress responseandroid httprequest 压缩响应
【发布时间】:2010-01-14 10:03:20
【问题描述】:

我正在使用 httprequest 从 web 服务中检索数据,我知道使用 tomcat 我们可以使用 gunzip 算法压缩响应数据。

但是如何解压缩数据以显示,解压缩是否耗时?有没有其他方法可以在android上压缩响应和解压缩???

【问题讨论】:

    标签: android compression response httprequest


    【解决方案1】:

    an example on the Apache website showing how to do gzip decompression with HTTPRequest and DefaultHTTPClient。 (您可以找到HTTPClient 示例here 的完整列表。)

    至于耗时多长,找出数据的最佳方法是分析应用中处理压缩和未压缩数据的情况。使用the traceview tool 很容易做到这一点。

    【讨论】:

    • 这甚至可能不是必需的——前几天我使用DefaultHttpClient 编写了一个类,它会自动接受并解压缩gzipped 响应,而无需我做任何特别的事情。那是在 PC 上,但我不明白为什么 Android 上的行为会有所不同。
    猜你喜欢
    • 1970-01-01
    • 2012-02-12
    • 1970-01-01
    • 1970-01-01
    • 2023-01-25
    • 2013-11-02
    • 2014-02-20
    • 2020-01-09
    相关资源
    最近更新 更多