接收XML文件被破坏(Sprint网络上的)? [英] Receive xml file is corrupted (on sprint network)?

查看:170
本文介绍了接收XML文件被破坏(Sprint网络上的)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的Andr​​oid应用程序一个很奇怪的问题。我从服务器接收XML文件和基于XML的内容进行操作。

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

这是几乎每一个网络如工作。 AT& T公司,Verizon公司在美国,Airtel公司,沃达丰和其他india.But它不工作的Sprint网络USA。

It is working on almost every network for eg. AT&T, Verizon in USA, airtel, vodaphone and others in india.But it not working on sprint network USA.

当我试图找到XML内容我得到一些字节code或单向code不是纯XML文件。我找了更多的信息,我发现了其他也面临冲刺evdeo这个问题。人们说,关掉手机字节优化这里

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 here

我不能够关闭手机字节优化。如果我切换到WIFI网络接收其文件中正确。问题只发生冲刺蜂窝网络。

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

任何帮助或任何指针将是非常美联社preciated。在此先感谢

Any help or any pointer will be very much appreciated. Thanks in advance

推荐答案

谢谢大家为应对我的查询我已经解决了这几天就回来。

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

其实冲刺COM preSS使用gzip编码任何XML文件。我试着用解压缩之后它的工作就像魅力的HTTP响应。大多数网络提供COM preSS音频/视频数据,但冲刺正在为在网络上发送的所有数据。

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.

我用下面的code这解决了我的问题。

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);

这篇关于接收XML文件被破坏(Sprint网络上的)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆