Java on the iPhone at JavaOne. But would Apple ever allow it?

Discussions

News: Java on the iPhone at JavaOne. But would Apple ever allow it?

  1. Black Magic: Java on the iOS

    In an effort to demonstrate just how far the tentacles of their new HTML5 based strategy will reach, Oracle’s Cameron Purdy and Adam Messinger demonstrated the deployment of a cross-platform application, written of course in Java, that would run on Windows based machines, machines running that operating system that shall not be named at any Oracle conference, and finally, to everyone’s delight: iOS.

    Listen to Oracle's Adam and Cameron talk about Java running on iOS (2 minutes)

    The Oracle demo application, running on the iPod Touch, wasn’t simply a hubristic attempt to demonstrate the fact that Oracle can now produce applications that run on the Apple platform; it was an attempt to demonstrate that their new strategy going forward will make a ‘write once, run anywhere’ the new reality.

    But how did they do it?

    The UI was simply written in HTML5, which allows iOS to render the application using native widgets. There’s nothing particularly earth shattering about that. It’s the wiring behind the visual rendering that raises questions.

    Java on iOS: Where is the JVM?

    The business logic the application was using was all written in Java, and it was running on the iPhone. Adam Messinger described it as “native HTML components from the iOS platform coupled with a JVM.” The UI is HTML5, but the model and controller are all Java. And if the model and controller are all Java, that means there has to be a JVM running in there somewhere.

    According to Adam Messinger, “The JVM is actually linked into the program. So the thing that gets download from the app store has a JVM linked into it.” The vernacular Java developers are familiar with is that an application runs on a Java Virtual Machine, not that a program has a JVM linked into it. So, what exactly does this mean?

    Is the application essentially like the product of a J++ program, where you would write code and create a Windows executable that runs natively? So you write in Java, but what gets created and compiled isn’t actually bytecode, but instead, native iOS instructions? That would likely get around the roadblocks Apple might put in the way of allowing a Java runtime to be downloaded from the iTunes store. But when demonstrating the application, Adam Messinger indicated that the application was running slow because the Just in Time compiler wasn’t quite working yet, which indicates that the implementation does in fact conform with how we expect Java based applications to behave at runtime.

    Will Apple allow it?

    It’s certainly exciting to see Java based technology running on iOS. But the nagging worry is that any download that even resembles a Java Virtual Machine will be immediately blocked by the control freaks that run Apple’s app store. If that’s the case, all the efforts of getting Java on iOS will be for naught.

     

  2. Black Magic: Java on the iOS

    In an effort to demonstrate just how far the tentacles of their new HTML5 based strategy will reach, Oracle’s Cameron Purdy and Adam Messinger demonstrated the deployment of a cross-platform application, written of course in Java, that would run on Windows based machines, machines running that operating system that shall not be named at any Oracle conference, and finally, to everyone’s delight: iOS.

    Listen to Oracle's Adam and Cameron talk about Java running on iOS (2 minutes)

    The Oracle demo application, running on the iPod Touch, wasn’t simply a hubristic attempt to demonstrate the fact that Oracle can now produce applications that run on the Apple platform; it was an attempt to demonstrate that their new strategy going forward will make a ‘write once, run anywhere’ the new reality.

    But how did they do it?

    The UI was simply written in HTML5, which allows iOS to render the application using native widgets. There’s nothing particularly earth shattering about that. It’s the wiring behind the visual rendering that raises questions.

    Java on iOS: Where is the JVM?

    The business logic the application was using was all written in Java, and it was running on the iPhone. Adam Messinger described it as “native HTML components from the iOS platform coupled with a JVM.” The UI is HTML5, but the model and controller are all Java. And if the model and controller are all Java, that means there has to be a JVM running in there somewhere.

    According to Adam Messinger, “The JVM is actually linked into the program. So the thing that gets download from the app store has a JVM linked into it.” The vernacular Java developers are familiar with is that an application runs on a Java Virtual Machine, not that a program has a JVM linked into it. So, what exactly does this mean?

    Is the application essentially like the product of a J++ program, where you would write code and create a Windows executable that runs natively? So you write in Java, but what gets created and compiled isn’t actually bytecode, but instead, native iOS instructions? That would likely get around the roadblocks Apple might put in the way of allowing a Java runtime to be downloaded from the iTunes store. But when demonstrating the application, Adam Messinger indicated that the application was running slow because the Just in Time compiler wasn’t quite working yet, which indicates that the implementation does in fact conform with how we expect Java based applications to behave at runtime.

    Will Apple allow it?

    It’s certainly exciting to see Java based technology running on iOS. But the nagging worry is that any download that even resembles a Java Virtual Machine will be immediately blocked by the control freaks that run Apple’s app store. If that’s the case, all the efforts of getting Java on iOS will be for naught.

     

  3. Having a JVM running in iOS may have a faint glimmer of hope in the future, but for now there's little that can be done in that space.  The upside to this is that there is a Java API for writing iOS apps (and Android and soon BlackBerry), which is a proxy API to Appcelerator's Titanium Mobile framework.  The Java API can be found and downloaded form www.emitrom.com/gwt4timobile, and with the aid of the GWT compiler all client side Java is translated to Javascript, which Titanium consumes and ultimately translates to native code.  This circumvents any problem the iTunes Police may have with JVMs of any sort, and Java developers get to do Java for iOS apps.

    GWT4Titanium Mobile also has GWT-RPC capabilities, so now an enterprise cross platform app can be written in Java from client to server.  Look for a tutorial in the forum on how to access a GWT service running on JBoss in the OpenShift cloud.

    Java is here to stay: either through frameworks like this or through a JVM on the device...

  4. It’s certainly exciting to see Java based technology running on iOS. But the nagging worry is that any download that even resembles a Java Virtual Machine will be immediately blocked by the control freaks that run Apple’s app store. If that’s the case, all the efforts of getting Java on iOS will be for naught.

    That horse left the barn a long time ago. You can run anything you want. What you can NOT do is execute "downloaded" code, and you can not convert memory from readable to executable at runtime. So, no JIT. The .NET runtimes handle this by compiling to machine code in advance, using an Ahead Of Time compiler. IBM appears to have one.

    So, just to nip that whine about iOS.

     

  5. GWT would be much better alternative and it is crose platform :)

  6. Vaadin TouchKit allows you to make iOS apps with Java - as web apps. The default theme and UI features in TouchKit makes the apps look and behaves exactly like native iOS apps.

    To try it, just open http://demo.vaadin.com/vornitologist/ in your phone - or drop it to the home screen. Works on Android as well.

  7. codenameone.com project, it’s a FOSS cross platform mobile framework provides java API's and tools to create native apps