2

Possible Duplicate:
Can we run Java applictions on iPhone?

Does IPhone4 supports Java? Can we write any app using Java for IPhone?

Community
  • 1
  • 1
Siva Arunachalam
  • 7,582
  • 15
  • 79
  • 132
  • If you want to use Java for mobile device programming, Android is a popular alternative to iPhone. But you probably already knew that. – darioo Nov 01 '10 at 12:26

6 Answers6

4

You should check out Tabris which allows you to write Apps for iOS with Java. It does not have the "JVM on iOS Problem", as the Java Application runs on a server. On the device a native App is installed, which communicates with the server and renders the UI like any other native App. It's similar to a thin-client approach. There is NO cross-compiling and NO browser/html5 used for the mobile App.

Jordi
  • 617
  • 6
  • 10
3

No, the iPhone iOS does not have any built in support for Java.

Yes, you theoretically could write a Java app for the iPhone if you are expert enough to develop or port a JVM and suitable runtime to iOS, and embed those with your Java app inside an iOS app. Or you could develop a Java compiler that would emit ARM object code or Objective C source code and use that.

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
2

iPhoneFAQ Says:

No. The iPhone will not support Java applications of any kind. Steve Jobs has been quoted as saying "Java's not worth building in. Nobody uses Java anymore. It's this big heavyweight ball and chain."

and here is a post on iPhone development using javascript iAd Libararies: http://eclipsesource.com/blogs/2010/06/11/writing-ipadiphoneipod-applications-with-swt/

Matt Lyons-Wood
  • 931
  • 11
  • 17
Aneef
  • 3,641
  • 10
  • 43
  • 67
  • 4
    just a note, iAd is JavaScript based. Java is to JavaScript as ham is to hamster, however the rest of the answer is correct. iPhone application development is pretty much tied down to ObjectiveC one way or another. You can develop web based applications and leverage the JavaScript support in Mobile Safari, and there are a number of the development frameworks that explicitly support this mode – Kevin Nov 01 '10 at 11:24
  • @Kevin sorry, i mixed up both. thanks for pointing it out :) – Aneef Nov 02 '10 at 09:07
  • 1
    I don't think this answers the question fully. The fact that there is no **official** support doesn't mean you can't do it. See MonoTouch for instance. Other initiatives like MonoTouch can be done with Java as the base language. – jv42 Jun 13 '11 at 12:08
  • The article using iAD/JavaScript is totally outdated. Here is an answer: http://stackoverflow.com/a/11682223/1463970 – Jordi Jul 27 '12 at 12:17
2

The problem with other languages is that iPhone apps aren't allowed to execute code from writable storage, which rules out any VMs. However, check out Monotouch - it compiles .NET code down to machine code (Ahead-Of-Time compiling) and is fully allowed by the app store (at the time of writing).

Matt Lyons-Wood
  • 931
  • 11
  • 17
0

The iPhone has some limited support for Java on iOS available with a "jailbroken" device, through the Cydia store.

0

Additionally to answers above.

You can't to develop your own JVM for iPhone or other translator or virtual machine. It's prohibited by Apple. So if you really do this you can distribute it only via hacking of native iPhone software.

Donz
  • 1,389
  • 1
  • 13
  • 21