bishopmatthew / HackerNews

An open source Hacker News client for Android.
230 stars 61 forks source link

Support for gzip in requests #60

Closed wakim closed 10 years ago

wakim commented 10 years ago

I use alot the app on my phone and one feature i suggest is to use gzip header on jsoup Connection. Because sometimes, not in home, i use 3g/4g and the app is using too much data in comparison with other apps.

Thank you.

pkillian commented 10 years ago

Hey @wakim; thanks for the suggestion here. Would you want an option in your user settings to include the GZip header? Maybe an option like "Data saver; compress responses from HN" so that users concerned about the data can try and remedy it as such?

wakim commented 10 years ago

An preference entry for this is a great option.

pkillian commented 10 years ago

Give me a few moments to look into it, and I'll see how easily one can be added!

pkillian commented 10 years ago

Good news @wakim; seems like all that's necessary is to add the 'Accept-Encoding: gzip' header to these lines and let the user's preferences toggle the option. I'll do some hacking on it, and hopefully have you a working version by tonight!

wakim commented 10 years ago

Thanks for the fast support!!

pkillian commented 10 years ago

PR #63 adds the Accept-Encoding: gzip to all requests that hit news.ycombinator.com, but there's still the issue of all the WebView instances (articles loaded in background for in-app viewing) being uncompressed.

pkillian commented 10 years ago

Support for WebView encoding headers added.

pkillian commented 10 years ago

Thanks for the bug report @wakim! I'll get in touch with @bishopmatthew and see if he can deploy a new version to the Play Store soon.