Restlet On Android - Issues with serialization
-
10-10-2019 - |
سؤال
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());
لا تنتمي إلى StackOverflow