How To Develop iPhone Applications in Java for Distribution (Without Jailbreaking)

By Angsuman Chakraborty, Gaea News Network
Sunday, November 16, 2008

iPhone is a great phone to develop applications for. Unfortunately Apple decided to restrict developing iPhone applications in a less known language called Objective C, which is used pretty much within Apple (and by Apple developers) and almost noweher else. Only Steve Jobs knows the reason behind this strange decision. Java ( J2ME) is the most popular language & platform for mobile development. So Java developers need a way to develop applications for iPhone too by leveraging their core competency.

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 https://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.

Discussion

sunny
May 14, 2010: 1:05 pm

Hi,
i develop apps for symbian OS in java but i also want to develop for iphone, can anybody help me with this


Brian
June 7, 2009: 9:05 pm

Great tool for development. Thank you.


hemant
February 13, 2009: 10:15 am

angsuman did great job ,what i m finding , and he just said is this for u . thanks angsuman

hemant


Sateesh
February 11, 2009: 11:29 am

I am new to the mobile applications. Upon research I found that the Android is providing the SDK to develop the mobile applications in JAVA. Can Anyone help in finding out how to implement the iPhone applications using Java. Are there any tools/plug-in/frameworks available.

Thanks.
Sateesh.

January 27, 2009: 10:58 pm

The default language for iPhone programming is Objective C, a language primarily used by Apple and Apple only. We are providing you a way to develop applications in Java and still be able to distribute it as iPhone app.


Rohit Akhauri
January 27, 2009: 10:06 pm

Hi, Pls let me know what kind programming knowledge is required to develop an app for iPhone. And also, if I dont have particular skill can it be learnt ? I have an awesome idea.
Thanks

January 21, 2009: 7:07 pm

Great post! I’m an iPhone Application Developer myself. Let me know if I can help you with anything.

Sam Shaw


Saul
January 19, 2009: 4:45 pm

Great entry site for this platform.

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :