سؤال

I am trying to retrieve serialized classes using Restlet 2.1 with Android as the client and GAE as the server. This is the relevant code:

ClientResource cr = new ClientResource("http://localhost:8888/mydata");
// Get the MyData object
MyDataResource resource = cr.wrap(MyDataResource.class);
MyData myData = resource.retrieve();

I initially tested this in a standalone JSE class, and everything worked fine. When I try to run the same thing in Android, the myData object is null. Any ideas?

هل كانت مفيدة؟

المحلول

You can check here the Android specificities: RESTLet android page

I spent few hours before to understand the problem as well, you need to explicitly register the Jackson convertor like that :

Engine.getInstance().getRegisteredConverters().add(new JacksonConverter());
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top