我正在尝试使用OData构建Android应用程序。我只想通过使用OData建立与Web服务器的连接。我正在使用Eclipse,它在Android项目之外工作正常。但是,在使用Android项目时,同一语句会引发异常。以下语句称为:
ODataConsumer c = ODataJerseyConsumer.create(“http://services.odata.org/Northwind/Northwind.svc”); 列表listEntities = c.getEntities(“Categories”)。execute()。toList();
仍然创建了ODataConsumer的实例,但第二个语句(c.getEntities ..)上升了一个运行时异常。如前所述,它在非Android项目中运行良好。我正在使用捆绑“odata4j-0.7.0-clientbundle.jar”和Android 4.1(ADT r20)。
构建路径包括: - “android.jar”用于构建路径“Android 4.1 - odata4j-0.7.0-clientbundle.jar和android-support-v4.jar用于路径“Android依赖” 没别的。
请不要知道这种行为的原因是什么。
谢谢和最好的问候