Java libraries in iOS target


Are there any restrictions on which libraries that I use in my Android app will work on an iOS device?

Can I expect the nio tcp and udp APIs making socket calls to work in an iOS environment?

Would the Jackson object serialiser, the greenrobot eventbus and android timber logging work within an iOS environment?


Dear James Cowan,

you can only be sure by trying them out. As long as a library only uses core classes (ones which you can find in the moe-core.jar), it should work fine. There could be some issues at runtime, for example if a library assumes that it’s working with an Android filesystem structure, that would be a false assumption with MOE.

Best Regards,

1 Like

Dear James,

to expand a bit the answer from Kristóf: if you already have an Android app, you can use the Migeran Analyzer to see which parts of the app will work out of the box on MOE. The analyzer will provide you with a report in XLS format, where each class / interface is listed that is using classes that are not present on MOE.

From the concrete examples that you listed:

  • NIO works

  • Jackson works (you should use MOE 1.2.5, because a code generation bug was triggered by Jackson in earlier versions)

  • Greenrobot is untested, but we are very interested in making it work, if possible. Please let us know if you run into issues with it, we are happy to help.

  • Android timber logging should work (if it only uses the standard android Log as backend). If it does not work, please let us know, and we will make it work, because this is a very basic library that we want to be available on MOE as well.

In general, if there is a widely used Java library, we want it to be available on MOE as well. For example, we created MOE specific backend for RxJava (note that the sample project should be probably updated to MOE 1.2+).

Best Regards,

1 Like

I’ve used Jackson, it works fine.

I didn’t try the main EventBus release, it does have Android dependencies so I assumed it wouldn’t work. Instead, I’ve used the ‘plain-java’ branch of EventBus which looks like it is working fine so far:

Haven’t used android timber logger so don’t know if that would work.

Thanks for the replies.

Is there a document describing how moe works on an iOS device? Is the java code code generated into binary or is there an embedded Java VM?

If it is code generated which github repo contains the source of the code generator?