tags:

views:

144

answers:

3

Does anyone know where or how to obtain a Java example to create iPhone apps? What I am looking for is just using Java (no objective-C or just the bare essential objective-C) and no interface builder, source only.

+7  A: 

There is no Java SDK for iPhone. XMLVM is something experimental from academy you might want to try. But it's not complete of intended for production use.

There is no Java ME API support in iPhone either. Or any other kind of Virtual Machine for that matter.

If you are looking for something similar to Java (but is not Java) you might give MonoTouch a try. It's Cocoa API for C#. From Miguel De Icaza and the great Mono devteam!

If you can live with your application running only on jail broken devices, you might try Cydia repository.

Pablo Santa Cruz
MonoTouch will also not run on iOS 4.0 due to restrictions on the license.
Etienne de Martel
@Etienne: Good point. Didn't know that. That's so sad :(
Pablo Santa Cruz
@Etienne: are you sure about that? Check out this url http://www.mono-project.com/newstouch/archive/2010/Jun-25.html
Pablo Santa Cruz
The iOS 4 developer license agreement states: "Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited)." So much for Java or C#, eh?
Etienne de Martel
Then again, MonoTouch might run on iOS 4.0, but chances are good that MonoTouch applications won't get approved by Apple, and therefor can only run on jailbroken devices.
Etienne de Martel
Thanks for your ans..
Velmurugan
+1  A: 

Captain Steve don't want You to use Java, as it has an ugly font. (or something like that)

Your options are: target android*, or follow Captain Steve.

*) actually, android isn't really Java either, just really really nearly java, but with a crappy jvm and a lawsuit from oracle going on...

KarlP
A: 

If you want a very messy and unsupported build sequence, you might be able to write some sort of Objective C wrapper library that would support using the output of one of the Java-to-C (Java2C? Toba?) translators. Note that this methodology may not comply with the iPhone SDK agreement.

But there is no supported tool or examples that I am aware of.

hotpaw2