Search code examples
androidrestlet

Restlet brings back null in android but not Java SE


I already have a solution - but would love an explanation why

Problem When doing a Restlet GET in Android - I great fine results with basic types (long) but I also have an Object with a ListArray being returned and that is always null. Works fine in a JAVA SE test app

I read the forums and saw someone mention including

Engine.getInstance().getRegisteredConverters().add(new JacksonConverter());

This works for me ! Great - but why ? I don't want my app to flake out on something else and not know how to understand and solve it.

Cheers


Solution

  • This is due to the fact that Android APK files excludes the META-INF/services directories used to automatically detect available converters in Restlet.

    Hence, you need to manually register them.