Previously I have provided two ways how Java developers can install, compile and run iPhone applications on Java. Today I will present a third method.
Apple's SDK for the iPhone, as you know, is based on Objective-C as the development language as well as Cocoa for the GUI.
Unfortunately Apple's super-restrictive license agreement for the iPhone SDK prohibits the porting of the Java virtual machine to the iPhone. Today we will talk about how we can use Open Source Java to run applications which will run on Apple's iPhone. The open source project by Arno Puder, Associate Professor at the San Francisco State University, uses a cross-compiler to convert Open Source Java code to Objective-C and provide a Java-based implementation of the Cocoa library. With the help of these tools, iPhone applications can be written in pure Java.
Using the Java version of Cocoa, it is possible to run a Java-based iPhone application as a Java desktop/applet application that can be cross-compiled to run natively on the iPhone.
You can find more details about the software from http://www.xmlvm.org/
XmlVM's SourceForge.net Subversion repository can only be checked out through SVN with the following instruction set:
svn co https://xmlvm.svn.sourceforge.net/svnroot/xmlvm xmlvm
Warning: This is a generic Subversion checkout command which will pull all modules, tags and/or branches of the project. In most cases, you will want to add '/trunk' to the HTTPS URL above to check out only trunk (main development line).
Each of the boxes in the diagram above represents an artifact while the arrows denote the various transformations between those artifacts. The input to the XMLVM toolchain is either a Java class file or a .NET executable. A Java class file is translated to XMLVMJVM which is an XML-document describing the contents of that class file. Likewise XMLVMCLR is an XML-document describing the contents of a .NET executable. XMLVMCLR can be cross-compiled to XMLVMJVM with the help of a data flow analysis (DFA) which is shown as XMLVMCLR-DFA in the figure below. XMLVMJVM serves as a canonical representation as it acts as a boundary between the front- and back-end of the cross-compiler. Once XMLVMJVM has been generated, it can be mapped to various high-level programming languages. It is also possible to map XMLVMJVM to a Java class file again.
Check it out. Also don't forget to read the detailed guide on how to install, compile & run Java applications on iPhone.
沒有留言:
張貼留言