IKVM.NET is a tool that can both act as a JVM implemented in C# and as a translator that translates Java bytecode into CIL. Shouldn’t this mean that one could use this tool to use the Mono runtime on iOS, BSD, Wii and PS3? I suppose that there could be a performance impairment, but other than that, I don’t really see any downsides.
LibGDX is using a modified version of IKVM.NET, and Monotouch to support iOS backend. Performance is pretty good, although there is still room for improvements.
I just discovered this: http://www.oracle.com/technetwork/developer-tools/adf/overview/adf-mobile-096323.html
Has anyone else heard of this Oracle ADF Mobile thing? Apparently it’ll allow us to target iOS?
Also I found this: https://code.google.com/p/j2objc/
Google’s J2Objc, converting Java to Objective-C to also target iOS!
Things like J2Objc are almost always incomplete, but this one actually seems to be reasonably complete. It seems to be source-to-source translation though, so you can’t use another JVM language. Besides, it’s only for iOS while IKVM.NET supports a whole lot of other platforms. One notable thing is that it’s open source and free though, which MonoTouch isn’t.
ADF looks interesting, though it depends on an IDE that I don’t use and haven’t seen ever before. It looks very complicated though, compared to firing up a console and typing some simple arguments. It’s cheaper than IKVM+MonoTouch and friends though, which is a plus.
I recently looked at J2ObjC for my own personal project.
It’s actually very complete, although it worries me that no changes or bugfixes have been made since the end of November.
It could actually provide a nice solution for OpenGL games seeking Desktop/Android/iOS, granted:
- No support for Java 7 features, nor should you rely too much on enums, generics and other Java syntax which may lead to weird/excessive translations.
- Ideally you shouldn’t rely on java.util or any other JRE classes but instead create your own cross-platform implementations. J2ObjC already does this for you in many places – i.e. they have re-written java.util.Date, HashMap and Properties in ObjC.
- Memory & garbage collection will always be a problem with more complex games since Java and ObjC are so fundamentally different.
So if you code carefully in Java, you could get some nice translations. Of course, at some point you will need to use ObjC, so you can’t fully escape it.
It’s a total bitch to set up, though, and wouldn’t work at all on my Macbook Air. I’ll try again next week on my desktop OSX to see how it fares. Even if all you can do is a simple 2D game, it could provide a nice (free) alternative to MonoTouch/LibGDX.
On the subject – there are some other tools coming out that achieve this cross-compatibility, albeit not with Java. e.g. MonkeyCoder and Moai.
A better free alternative would be Avian. Last thing i heard was that they gt the full JDK running on iOS in AOT mode. Needs some heavy proguarding though and has no debugging support.
Also, if you are a student, you can get MonoTouch for 80$.