1

When connected to 4G ATT network and downloading an image from my server using InputStream or BufferedInputStream, image size and quality is downgraded. When downloading the same picture from a google server, image quality is flawless. When connected to Wifi, T-Mobile or Verizon networks image quality is fine for both scenarios.

Succesful scenario shows 137 buffered read cycles of 1.3kb each. (174kb image) urlConnection.getContentLength() returns the appropriate file size and urlConnection.getInputStream().available() > 0.

Failed scenario shows 5 buffered reads varying from 1.3 to 4.1kb (13kb image) with urlConnection.getContentLength() returning -1 and urlConnection.getInputStream().available() returning 0. The connection header for this scenario shows Transfer-Encoding=[chunked]. Ive tried reading the input stream as chunked (https://stackoverflow.com/a/16646479/2333242) but loss of quality is still there.

At first I though the culprit was ATT which might be doing some throttling, but then I tethered this ATT connection to another identical phone and image quality is flawless. Using the Android image loader (http://developer.android.com/training/displaying-bitmaps/index.html) and hardcoding the urls of images located in my server shows the same loss of quality. I have played around with connection and read timeouts but the results are the same.

Any ideas what might be going on?

Community
  • 1
  • 1
Eugenio
  • 11
  • 2

1 Answers1

0

Wrong APN settings on AT&T phone was causing the data to be chunked. Always use default carrier settings.

Eugenio
  • 11
  • 2