How to create a "Hello World" application in java for iphone?

I would like to create a basic Hello World style iPhone app using Java - can anyone tell me how?

+3
java iphone
Oct 23 '08 at 13:18
source share
13 answers

You cannot code in Java for iPhone. IPhone only supports C / C ++ / Objective-C - Cocoa.

However, under the current license, you can use the translation tools that generate this code. There are several solutions that do just that:

Codename One - focuses on building Java applications with visual tools and simulators. An open source SaaS backend that eliminates the need for a Mac.

XMLVM is a translator for converting Java bytecode to C / Objective-C. Open source, but at the moment you need to write specific iOS code.

There are also some proprietary solutions, but I have no experience with them. For example. AG software has a tool called web objects.

+11
Oct 23 '08 at 13:19
source share
— -

You might want to check out Alchemo for iphone . It converts your CLDC 1.1 MIPD 2.0 into iPhone native code. He even cares about memory management.

+8
Oct 23 '08 at 13:22
source share

There are two development methods for iPhone.

The best way is to use Objective-C and Cocoa.

An alternative is to create a web application with JavaScript, which they can access through the iPhone browser (but this will only be available to users connected to the network).

A good alternative if you want to create something like this in Java would be targeting the Google Android platform (for example, the G1 phone).

+5
Oct 23 '08 at 14:28
source share

I just stumbled upon this Google TechTalk video “Developing iPhone Applications Using Java .

+5
Oct 23 '08 at 21:44
source share

1) If you know J2ME, it is very simple. You write the code first.

2) Then download alcheMo for iPhone, which contains a translator to convert the source code of the J2ME application to the equivalent C ++ source code for the iPhone. alcheMo for iPhone is capable of converting J2ME applications using an extensive subset of Java ME CLDC 1.1 and MIDP 2.0 (including touch screen support) and supports several JSR APIs, including the JSR-256 Mobile Sensor API.

+4
23 Oct. '08 at 18:28
source share

Short answer: you cannot, Java is not supported. See how: http://developer.apple.com/iphone/
http://blogs.zdnet.com/Burnette/?p=338
It may support the internal Java environment, but developers cannot use it yet. I am

+2
Oct 23 '08 at 13:21
source share

As of now, Java is not supported on the iPhone. You can use Objective-C and then cross-compile it into a Java application. Sun Microsystems is working with Apple to make iphone java capable. As mentioned above, Cocoa is the best language for developing iphone apps.

+1
Oct 23 '08 at 14:14
source share

If you really want to develop Java applications on the iPhone (or any other phone that supports some other language), you can get the JVM (Java Virtual Machine) to work with C ++ / Cocoa (headers / wrappers) and then call the code Java from C ++ or through the JVM interface.

Although I'm not sure how much experience you have. This will take some time and experience, but I'm sure the interface for the JVM for C ++ at least floats somewhere that you can use this way.

+1
Oct 23 '08 at 18:34
source share

You can write Java code and translate it to Objective-C using XMLVM .

+1
Oct 27 '08 at 18:15
source share

As already mentioned, Java is not officially supported. But if you absolutely must run Java, you can jailbreak your phone and run Java this way. I'm not going to provide jailbreaking instructions on your phone, it's easy enough to translate it.

Cydia, one of the applications / installers that you install when jailbreaking, has a Java installer that you can use. It uses JamVM, a small, lightweight JVM.

Through Cydia, you can also install some demo applications, including a sample HelloWorld console application. In addition, I heard that people got Jetty to work on the iPhone, but they didn’t try it.

Java GUI development on iPhone is currently a work in progress. To learn more, there is an iPhone-Java mailing list you can subscribe to. The Java level makes its own calls at the Objective-C level and is not very Java oriented. You need to understand how to create code in Objective-C to create a graphical interface.

+1
Oct 27 '08 at 18:38
source share

Check out this new platform http://www.codenameone.com (FOSS), which provides a java framework that compiles your java code into Objective-c and provides you with a native application

+1
Mar 20 '12 at 11:27
source share

According to http://www.mono-project.com/Mono:Iphone Mono is ported to iPhone and is available as a commercial product called MonoTouch. This can be a good way to get up and running quickly if you know C # but not Objective C.

0
Sep 30 '09 at 21:47
source share

If you are jailbroken, you can use Cydia to find the java compiler, Jikes and the necessary units, and you can write, compile and run on the iPhone. Of course, I will never do this, as this violates Apple EULA: p

0
Jun 09 '10 at 3:16
source share



All Articles