iphone-java: Get subverted
To catch you up with our story: Between his work on Cydia, Winterboard, and getting a full gcc toolchain to run on iphoneos, the indefatigable Saurik has also created jocstrap, the amusingly named Java to Objective-C bootstrapping library. Jocstrap enables Java code running on jailbroken iPhones to access most (and eventually all) of the iPhone SDK APIs, meaning Java applications can use the native look and feel widgets and participate in the windowing and event system on the iPhone*. All this runs on top of the jamvm bytecode interpreter and GNU Classpath system libraries. So Java on the iPhone is getting more and more stable by the day, and while it's limited to jailbroken devices at this point, there's a hope that the GCJ ahead-of-time bytecode compiler can be ported to work on the platform, meaning apps written in Java could potentially get around Apple's restriction on interpreted programs being sold on the AppStore. Of course there are a lot of missing pieces still, and one of my major goals is to get a more intuitive API working for Java that abstracts away the messiness of bridging to the native functions. To this end I've been working on a MIDP implementation that is roughly based on the GPL PhoneME project. At the moment it does little more than run a HelloWorld MIDlet, but it does that with gusto. And having converted it over to use the 2.0 SDK APIs, it's about time the source saw the light of day on its own little subversion server. So here it is: svn checkout http://svn.tralfamadore.com/repos/iphone There are three directories here:
- midp - containing the work-in-progress MIDP implementation. This all builds to a midp.jar file, but includes a main class (currently javax.microedition.midlet.Runner) that acts as a MIDlet chooser and can be wrapped into an iPhone .app bundle (currently this is left as an exercise to the reader, but I'll add it to the build script soon).
- jocenum - a small shell script to generate Java constant (public static final ints) declarations from the enums in the iPhone SDK headers
- share - containing jocstrap and other JAR files for MIDP (and any other projects that might live here) to link against.