Hacker News new | comments | show | ask | jobs | submit login
Java for iPhone (codenameone.com)
51 points by suyash on July 26, 2012 | hide | past | web | favorite | 30 comments

This isn't "running Java on iOS". This is cross-compiling Java to Objective C, the exact same way that other toolkits like MonoTouch, Titanium and RubyMotion do it.

The difference is important.

You can use this toolkit to target iOS from Java, but that doesn't mean that you get that language's infrastructure with it. I'd argue that's probably a good thing, but either way it's a far cry from "running Java on iOS".

MonoTouch does not compile to Objective-C. It compiles to native code, just like Objective-C, very much like Mono, CLR, or JVM do on other platforms. The real difference is running the compiler ahead of time, versus JIT. That, and disabling some functions that Apple deems bad, like keeping the ability to modify or emit code on-the-fly.

In the case of MonoTouch, you do get the infrastructure; they have the runtime ported over, and other libraries get compiled in as needed. So, in Mono's case, it IS "running .NET on iOS".

I see no intrinsic reason this could not be done for Java, although I don't know what this specific implementation is doing.

None of those things compile to Objective-C. They each provide a runtime for C#, Javascript and Ruby respectively with bindings to the underlying Objective-C apis. And they each do it in a different way, with different levels of layers between the normal Cocoa APIs.

What 'language infrastructure' are you talking about?

> You can use this toolkit to target iOS from Java, but that doesn't mean that you get that language's infrastructure with it.

I failed to understand you here. Assuming the Java language runtime is also available in native code, this is no different than using any other compiled language runtime like, say Objective-C.

Yeah, from the site it looks like they are running "true native applications", so probably using native UI widgets.

This just looks... Wrong :) Doesn't look or feel like iOS at all...

Of course not. Like so many desktop Java apps, it will look and feel like Java, no matter where it's running.

To be fair, it's hard to know how much of that sluggishness is the app itself and how much is just a video-encoding artefact.

Certainly the API has some interesting inclusions -- Facebook and analytics built-in.

Also note that the demo video is from the Simulator, not an actual device.

Which is probably worse - the Simulator consistently outperforms any real device.

Of course, good UI toolkits do exist for Java, but nobody just uses them. SWT and Qt both provide native UI.

> This just looks... Wrong :) Doesn't look or feel like iOS at all...

I don't know, looks like game center to me :/

As someone who's put together a few iPhone apps (hell, used an iPhone app) in his day, that looks fucking terrible.

The iPhone really sensitized people to fluid and seamless design.

So much negativity here. IMO the themes alone could be worth it. However the whole thing seems a bit laggy in the simulator he shows. 3GS is still on sale and I find that even with native iOS 5 it feels slow - I wouldn't want to run such a heavy handed framework on there.

Did any of you really use it or only look at the video? I agree that the UI needs much more work (the entire Swing programming is really old - and not really convenient). I really didn't like the resource-ui tool. However, being able to write once and compile on the cloud (not needing to open 2 environments - eclipse & xcode ide like in PhoneGap is a huge plus). If they will get their act together regarding the UI (html and css for example)they might be the winner in cross-platform development world... Also I wonder their future support in Scala.

It seems that you are talking about something like RhoMobile Rhodes open source Framework[1] and the RhoHub hosting solution[2]. Rhodes uses HTML5 and ruby to target multiple OSes and RhoHub allows you to build this apps in the cloud.

[1] https://github.com/rhomobile/rhodes

[2] https://app.rhohub.com/

disclaimer: I work for Motorola Solution, the parent company of RhoMobile.

I prefer native or html5 for fast deployment - how are the performance in Rhodes (from yours experiences not from "Google Result") vs native?

I've used this in the past to get something across Android, J2ME and iOS -- even with the best of intentions an app turns out like a ugly mutant frankenstein.

I think this is a little too heavyweight. Since platform-consistent UX is so important, I'd prefer to stick with Apple's tools--at least for UI development. It's usually easy to tell when an app is faking the native look-and-feel in a webview, for example, and I doubt that this will be much different.

It's usually easy to tell when an app is faking the native look-and-feel in a webview, for example, and I doubt that this will be much different

It looks like this uses native peer controls; ie it will appear identical to a platform specific app because the compiled version is platform specific.

Why is it so hard for Java programmers to learn anything other than Java?!

Unrelated to the original post.

This will come off as condescending, but I mean it with the best intentions. I see that you are relatively new in HN. Comments like these are nonconstructive and generally frowned upon here.

I'm not saying that your criticism isn't valid (or otherwise), but its preferable to include some actual notations, quotes or reason behind such statements.

Overall comment: Such blanket statements are insulting, and usually erroneous. All programmers are capable to learn anything else as long as they are interested and willing.

Er - as a seasoned Java programmer I think you'll find I've worked in C++, C#, PHP, and any other number of languages thankyou-oh-so-very-much.


Original post. iOS in Java?! Why?! GWT! Why. Just learn ObjC, Javascript, whatever the local language is... It's not that hard really...

The same can be applied to legions of other programmers that what to everything in C, Python, Ruby, JavaScript, whatever is their be and end all language...

The advertised benefit is reusing your code across platforms.

yes, write once, lag everywhere.

it's just that the syntax of ObjC is a total mind fuck. Wish you could code in whatever you wanted and then compile to native code with a plain compiler, no need for the UI designer BS. Just give me a Java to native compiler and wrappers to all the Cocoa libraries.

the video looks really really strange

Applications are open for YC Winter 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact