我试图使用的Restlet为Android来查询的OData数据源。不过,我不是IM pressed其在这两个模拟器性能,以及在真实设备。我有一个包装的AsyncTask
来使UI响应,但它仍然需要超过1分钟,最后返回的对象。
I am attempting to use Restlet for Android to query an OData data source. However, I am not impressed with its performance in both the emulator as well on a real device. I have the requests made in a wrapper AsyncTask
to make the UI responsive but it still takes over 1 minute to finally return the objects.
我得到很多的这些在LogCat中的窗口:
I get plenty of these in the LogCat window:
10-04 18:20:41.667: DEBUG/dalvikvm(278): GC freed 7872 objects / 523928 bytes in 279ms
我能做些什么,以加快查询?
What can I do to speed up the queries?
推荐答案
查看odata4j - http://odata4j.org 这是一种用于Java的替代ODATA库,包括一个Android兼容的客户端API。
Check out odata4j - http://odata4j.org This is an alternative odata library for java, including an android-compatible client api.
我们只是在我们的0.3版本发布了一个简单的Android客户端的例子。本实施例说明解析/寻呼的任意ODATA服务的有效方法。
We just released a simple android client example in our 0.3 release. This example demonstrates an efficient way of parsing/paging an arbitrary odata service.
随着服务分页驱动(由Alex提及),我们使用了高效的XML解析器拉落实解析ODATA有效载荷(我们发现堆活动/ GC的是Android上的最大瓶颈PERF)。
Along with service driven paging (mentioned by Alex), we use the efficient xml pull parser implementation to parse the odata payload (we found heap activity/GCs to be the biggest perf bottleneck on android).
相关推荐
最新文章