6 ms·
Develop iOS Apps in Java with RoboVM
- slacka 13y agoThere are currently two open source AOT compilers RoboVM and avian that can be used for cross-platform iOS/Android development. Both seem to be in pre-alpha state. Seems like a better option would be to use apportable and go the other way from iOS to android. Anyone here have any experience with these? http://oss.readytalk.com/avian/ http://oss.readytalk.com/avian/ http://www.apportable.com/ http://www.apportable.com/
- ksec 13y agoI rememberer long time ago when i was still in the land of Java I researched the topic there were GCJ as well. Dont know what happened to it And Something called ExcelsiorJET as well.
- pjmlp 13y agoGCJ is dead, as most developers went away to OpenJDK or just lost interest. Besides ExcelsiorJET, Aonix and IBM Webpshere Real Time VM do also offer AOT compilation.
- moondowner 13y agoLet's not forget that RoboVM is still alpha, and on Sept 09th version 0.0.4 was released: http://blog.robovm.org/2013/09/robovm-004-released.html http://blog.robovm.org/2013/09/robovm-004-released.html Here's an interesting blog post on RoboVM: "JavaFX On IOS Using RoboVM And Maven" http://www.zenjava.com/2013/08/01/javafx-on-ios-using-robovm-and-maven/ http://www.zenjava.com/2013/08/01/javafx-on-ios-using-robovm...
- badlogic 13y agoNiklas, the author or RoboVM, just send his first submission to the App Store, we'll see how that pans out. In the meantime, lots of folks from the libgdx community (JVM game dev framework) already ported many non-trivial games to RoboVM, without any big issues, e.g. [1][2] Current limitations: no debugging, Boehm GC (though anything except stack references are collected precisely) and the ObjC -> Java bindings are a bit in flux. I personally would like to see the ObjC bindings ala Xamarin get done. JavaFX is a trainwreck in my opinion. I think that would also be a really good business opportunity for Niklas/Trillian, i can see tons of enterprises wanting to code their iOS apps via a JVM language. RoboVM already has Maven/STB plugins available, so development is very smooth. And compile times beat Xamarin easily. What gets me really excited is that RoboVM supports Scala out of the box. Writing iOS/Android/desktop games and apps in Scala would be amazing. [1] http://www.youtube.com/watch?v=h0Ro41uamD0 http://www.youtube.com/watch?v=h0Ro41uamD0 [2] https://twitter.com/RainerBasso/status/378621566206369792 https://twitter.com/RainerBasso/status/378621566206369792
- ape4 13y agoIt compiles the Java but what about the big VM needed? Found my answer: Note! When you compile a program using RoboVM it will translate not only the main class into native code but also the transitive dependencies of that main class. So the first time you compile a program for a particular CPU and OS RoboVM also compiles many of the standard runtime classes such as java.lang.Object, java.lang.String, etc. A simple class like HelloWorld references about 1500 classes directly or indirectly. RoboVM keeps a cache of compiled classes and only recompiles a class when it or any of its direct dependencies have changed. Wow
- booop 13y agoThis is exciting. But wouldn't this result in very large final binary sizes?
- pjmlp 13y agoYes and no. This can happen even in languages like C when you do static linking. The solution is to have the linker remove all code that is not being called. The consequence of it, it that you are restricted in doing reflection, for example. Some Java native compilers allow you to provide a list of methods to leave alone, to avoid them being removed from the final executable.
- wiradikusuma 13y agoShould be able to use ProGuard, a code obfusticator+trimmer for Java. http://proguard.sourceforge.net/ http://proguard.sourceforge.net/ Although, from my experience doing Android with Scala, the process is slow.
- cheapsteak 13y ago"Read a few links on HN" slow, or "time to make some coffee" slow?
- tluyben2 13y agoYou only need it a few times when getting ready for distribution.
- bsaul 13y agoAnyone knows if roboVM is using the same approach as MonoTouch uses ? I've always been curious to know how those two operated. Do they link iOS frameworks C libraries and just provide wrappers in a C# or Java lib (which are then compiled to bytecode then native) ?
- cromwellian 13y agoThere's also a source-to-source translator that google uses, j2objc https://code.google.com/p/j2objc/ https://code.google.com/p/j2objc/
- AntiRush 13y agoAnother project targeting Java on iOS is XMLVM[1]. It has several frontends, including JVM bytecode, and several backends, including Objective-C (and vanilla C, these days). 1. http://xmlvm.org/overview/ http://xmlvm.org/overview/
- mramir 13y agoInversely, there is a tool for writing iOS apps in Objective-C and then porting it to native Android : http://www.apportable.com/ http://www.apportable.com/ There are also dozens of tools for developing native apps in many platforms with HTML5/JavaScript, most notably Titanium : http://www.appcelerator.com/platform/titanium-platform/ http://www.appcelerator.com/platform/titanium-platform/.