简体   繁体   中英

how to create a Proxy for accessing OData Service on android

I'm new to android and i am following this tutorial to access an OData service on android. I am stuck where I have to make a proxy to access the Odata service. can anyone tell me how to make a proxy? the tutorial says to develop it using:

IDataServiceProxy proxy = new DataServiceAtomPubProxyImpl(DataServiceClient.URL);

i have tried to include it in my MainActivity.java but it is not working. Can you tell me where are these classes defined: IDataServiceProxy, DataServiceAtomPubProxyImpl , DataServiceClient. ? and how to proceed on with making a proxy for my android app?

The example does not explain this, but it is actually quite simple:

If you look into the files you imported from the java-project, you should have one file named something like: " MyData OdataAppService.java ". This is your service, not the other files you see in the example.

To get the service you simply create a new instance of this:

MyDataOdataAppService service = new MyDataOdataAppService ();

... then you can run service.createMyItemQuery("............");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM