Search code examples
odataadtodata4j

ODataConsumer create method undefined - ADT - Build: v21.1.0-569685


I'm entering the world of android development, i haven't written java since uni (some time ago now). I have written and deployed a working WCF Data Service and am now attempting to consumer that service from my android app.

i've been reading blogs and following tutorials and everything starts with

ODataConsumer c = ODataConsumer.create("http://www.tooks-net.co.uk/DataService/PublicDataService.svc/");
List<OEntity> list = c.getEntities("NewsBulletins").execute().toList();

the problem that i am getting won't even let me run the app to see if the service will connect and retrieve the list of news. The error i get in eclipse is this:

The method create(String) is undefined for the type ODataConsumer

Like i said, all documentation says to start with ODataConsumer.create and it won't let me get even that far.

What i've done so far is. Follow the the android training programme here http://developer.android.com/training/basics/firstapp/index.html until the point where i create a new activity and start that, but instead of displaying the message entered i run the above code.

What have i missed? Thanks in advance!


Solution

  • You have to use

    ODataConsumer c = ODataJerseyConsumer.create("http://www.tooks-net.co.uk/DataService/PublicDataService.svc");
    

    Make sure that you added the clientbundle jar (the latest is odata4j-0.7.0-clientbundle.jar).