Restlet On Android - Issues with serialization
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 worke开发者_Python百科d 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());
精彩评论