Search code examples
javaandroidobjective-cjsonj2objc

JSON <=> Java Object Mapper which translates well with J2objc


I use the org.json.* classes which are part of the j2objc distribution. The mapping of my DTO classes and the JSON Objects are made by hand so far. I know there is GSOn and Jackson.

Is there a JSON to Object Mapper library which translates well with J2objc and works well in the translated Objective-C code?


Solution

  • Jackson and GSON are the two best libraries, and both have been translated using j2objc for iOS apps from different teams (no public ports that I'm aware of, though).

    If you control the server-side of the app, though, protocol buffers are generally faster than any JSON->Java alternative. That is why they're used by most of Google's iOS apps, including Inbox and Sheets that use j2objc. j2objc now publicly supports protocol buffers.