0

http://pastebin.com/ntp3hi7j

使用上面的代码,我可以下载一些数据,例如'Limit = 5/10',但是当我尝试下载'Limit = 50'时,它给了我以下错误:

> 10-02 06:44:28.075: E/AndroidRuntime(27598): FATAL EXCEPTION:
> pool-1-thread-1 10-02 06:44:28.075: E/AndroidRuntime(27598):
> java.lang.OutOfMemoryError 10-02 06:44:28.075:
> E/AndroidRuntime(27598):  at
> java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:94)
> 10-02 06:44:28.075: E/AndroidRuntime(27598):  at
> java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:124)
> 10-02 06:44:28.075: E/AndroidRuntime(27598):  at
> java.lang.StringBuilder.append(StringBuilder.java:271) 10-02
> 06:44:28.075: E/AndroidRuntime(27598):    at
> org.kxml2.io.KXmlParser.readValue(KXmlParser.java:1338) 10-02
> 06:44:28.075: E/AndroidRuntime(27598):    at
> org.kxml2.io.KXmlParser.next(KXmlParser.java:390) 10-02 06:44:28.075:
> E/AndroidRuntime(27598):  at
> org.kxml2.io.KXmlParser.next(KXmlParser.java:310) 10-02 06:44:28.075:
> E/AndroidRuntime(27598):  at
> org.kxml2.io.KXmlParser.nextText(KXmlParser.java:2056) 10-02
> 06:44:28.075: E/AndroidRuntime(27598):    at
> org.ksoap2.serialization.DM.readInstance(DM.java:35) 10-02
> 06:44:28.075: E/AndroidRuntime(27598):    at
> org.ksoap2.serialization.SoapSerializationEnvelope.readInstance(SoapSerializationEnvelope.java:428)
> 10-02 06:44:28.075: E/AndroidRuntime(27598):  at
> org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:387)
> 10-02 06:44:28.075: E/AndroidRuntime(27598):  at
> org.ksoap2.serialization.SoapSerializationEnvelope.readUnknown(SoapSerializationEnvelope.java:273)
> 10-02 06:44:28.075: E/AndroidRuntime(27598):  at
> org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:389)
> 10-02 06:44:28.075: E/AndroidRuntime(27598):  at
> org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:151)
> 10-02 06:44:28.075: E/AndroidRuntime(27598):  at
> org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:140) 10-02
> 06:44:28.075: E/AndroidRuntime(27598):    at
> org.ksoap2.transport.Transport.parseResponse(Transport.java:118) 10-02
> 06:44:28.075: E/AndroidRuntime(27598):    at
> org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:253)
> 10-02 06:44:28.075: E/AndroidRuntime(27598):  at
> org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:116)
> 10-02 06:44:28.075: E/AndroidRuntime(27598):  at
> org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:111)
> 10-02 06:44:28.075: E/AndroidRuntime(27598):  at
> com.example.inforlider.SyncActivity$4.run(SyncActivity.java:189) 10-02
> 06:44:28.075: E/AndroidRuntime(27598):    at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
> 10-02 06:44:28.075: E/AndroidRuntime(27598):  at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
> 10-02 06:44:28.075: E/AndroidRuntime(27598):  at
> java.lang.Thread.run(Thread.java:841)

问题之一可能是因为“图像”字段,因为它是一个 BLOB 并返回一个非常大的字符串?

我能做些什么?谢谢。

4

2 回答 2

0

我通过不包含“图像”字段解决了这个问题,因为它是函数中的 BLOB(大数据)。之前,我创建了另一个函数来读取“图像”字段。

于 2013-10-02T15:37:10.880 回答
0

获取您的肥皂 xml 并将其保存到手机存储中,然后对其进行解析。当 xml 存储在内存中时,您不应该解析它。

您可以参考:如何从服务器下载 XML 文件并将其保存在 SD 卡中?

于 2013-10-02T11:11:52.547 回答