1

I am having a very strange issue in my Android app. I receive XML file from server and perform operation based on XML content.

It is working on almost every network for e.g. AT&T, Verizon in USA, airtel, Vodafone, and others in India. But it not working on sprint network USA.

When I tried to find XML content I am getting some byte code or unicode not the plain XML file. I looked for more information I found other also has faced this issue on sprint evdeo. People says turn off byte mobile optimization.

I am not able to turn off mobile byte optimization. If I switch to Wi-Fi network it receive file properly. Issue occur on sprint cellular network only.

Dharman
  • 30,962
  • 25
  • 85
  • 135
CodingRat
  • 1,934
  • 3
  • 23
  • 43
  • Maybe you can add some header that will force this optimization to be off. It is for sure network specific but they must refrain from doing it to streams (for example). Adding a header that will trick them would do the trick – Sherif elKhatib Oct 03 '13 at 15:02
  • @SherifelKhatib thanks for reply but i already tried this. No help. I changed content mime type, charset type etc but nothing worked. – CodingRat Oct 03 '13 at 17:22
  • Could you post what you're getting, and what you expect to get? – hichris123 Oct 04 '13 at 00:01

3 Answers3

2

Thanks everybody for responding my queries i have resolved it few days back.

Actually sprint compress any xml file using gzip encoding. I tried to unzip the Http response using following it worked like charm. Most of the network provide compress audio/video data but sprint is doing for all data sent across the network.

I use following code which resolved my issue.

HttpEntity httpEntity = reponseData.getEntity();
InputStream res = AndroidHttpClient.getUngzippedContent(httpEntity);
linputSourceFromServerResponse = new InputSource(res);
Document doc = builder.parse(linputSourceFromServerResponse);
CodingRat
  • 1,934
  • 3
  • 23
  • 43
1

Check if the ouput is just a gzipped xml. Use GZIPInputStream to read the plain xml.

flx
  • 14,146
  • 11
  • 55
  • 70
0

With a first sight, looks like an encoding issue.. If it is possible, you could send an email to sprint network and explain your problem, maybe they ll give you an answer or a logical explanation.

karvoynistas
  • 1,295
  • 1
  • 14
  • 30