How do I create a "Hello World" application in java for an iphone?
I'd like to create a basic "Hello World" style application for the IPhone using Java - can anyone tell me how?
Asked by: Marcus270 | Posted: 28-01-2022
Answer 1
You can't code in Java for iPhone. The iPhone only supports C/C++/Objective-C - Cocoa.
However, under the current license you can use translation tools that generate such code. There are several solutions that do exactly that:
Codename One - focuses on building applications using Java with visual tools and simulators. Open source with a SaaS backend that removes the need for a Mac.
XMLVM - a translator to convert Java bytecode to C/Objective-C. Open source, but requires writing iOS specific code at the moment.
There are also several proprietary solutions but I have no experience with them. E.g. Software AG has a tool called web objects.
Answered by: Cadie528 | Posted: 01-03-2022Answer 2
Might want to check Alchemo for iphone never used it myself yet. It convert your CLDC 1.1 MIPD 2.0 code into native iPhone code. It even take care of the memory management.
Answered by: Rafael719 | Posted: 01-03-2022Answer 3
There are 2 ways to develop for iPhone.
The best method is to use Objective-C and Cocoa.
The alternative is to create a web-based app with JavaScript which they can access through the iPhone browser (but this will only be available to users while connected to the web).
A good alternative if you want to create something similar in Java would be to target google's Android platform (e.g. the G1 handset)
Answered by: John606 | Posted: 01-03-2022Answer 4
I just stumbled upon this Google TechTalk video "Developing iPhone Applications using Java".
Answered by: David660 | Posted: 01-03-2022Answer 5
1) If you know J2ME, that is very easy. First you write the code.
2) Then download alcheMo for iPhone, contains translator to convert J2ME application source code to equivalent C++ source code for iPhone. alcheMo for iPhone is capable of converting J2ME applications utilizing an extensive subset of Java ME CLDC 1.1 and MIDP 2.0 (including touch screen support) and supports several JSR extension APIs including the JSR-256 mobile sensor API.
Answered by: Elian124 | Posted: 01-03-2022Answer 6
Short answer: you can't, Java isn't supported.
Check out how to: http://developer.apple.com/iphone/
http://blogs.zdnet.com/Burnette/?p=338
Well, maybe it does support Java internally, but developers cannot use it yet. i
Answer 7
As it stands right 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 the iphone java capable. As mentioned above Cocoa is the best language to use when developing applications for the iphone.
Answered by: Roman659 | Posted: 01-03-2022Answer 8
If you really want to develop java applications on an iPhone (or any other phone for that matter that supports some other language) you may be able to get the JVM (Java Virtual Machine) to work with C++/Cocoa (headers/wrappers) and then call your java code from C++ or through an interface to the JVM.
Although I'm not sure how much experience you have. Doing something like that would take some time and expertise, but I'm sure theres an interface for the JVM for C++ at least floating around somewhere that you could use in this fashion.
Answered by: Ada677 | Posted: 01-03-2022Answer 9
You can write the Java code and translate it to Objective-C using XMLVM.
Answered by: Dainton659 | Posted: 01-03-2022Answer 10
As has been said, Java is not officially supported. But if you absolutely must run Java, you can jailbreak your phone and run Java that way. I'm not going to provide instructions on Jailbreaking your phone, it is easy enough to google it.
Cydia, one of the applications/installers you install when you jailbreak, has a Java installer that you can use. It uses the JamVM, a small, lightweight JVM.
Through Cydia, you can also install some demo applications, including a sample HelloWorld console app. In addition, I have heard that people have gotten Jetty to work on the iPhone but have not tried it myself.
GUI development in Java on the iPhone is currently a work-in-progress. To find out more info, there is an iPhone-Java mailing list you can subscribe to. The Java layer is making native calls to the Objective-C layer and is not very Java-centric. You need to understand how to code in Objective-C to create a GUI.
Answered by: Sawyer689 | Posted: 01-03-2022Answer 11
Check out this new platform http://www.codenameone.com (FOSS) which provides a java framework which compiles your java code to Objective-c and provides you with a native app
Answered by: Roland242 | Posted: 01-03-2022Answer 12
According to http://www.mono-project.com/Mono:Iphone Mono has been ported to the iPhone and is available as a commercial product named MonoTouch. This might be a good way to get up and running quickly if you know C# but not Objective C.
Answered by: Aston827 | Posted: 01-03-2022Answer 13
if you jailbreak, you can use Cydia to find the java compiler, Jikes, and the required units, and you can write, compile and run on the iPhone. Of course, I would never, ever do that, as it breaks Apple's EULA :p
Answered by: Anna317 | Posted: 01-03-2022Similar questions
Java: HTTP Post to create new “Ride†in a Ruby on Rails application
My question is very similar to Java: HTTP Post to create new "Product" in a Ruby on Rails application
I have a form that I want to "post" to a form that looks like this
Offer:<br />
<input id="ride_togive" name="ride[togive]" size="30" type="text" />
&l...
How to create a ruby API for a java application
Closed. This question needs to be more focused. It ...
What is the best way to create and send html emails though java application?
There have been some similar questions in stackoverflow but none of them answers my question.
We want to send html , emails to users after they complete some action. We have written email templates in xsl and use DOM elements to create nodes, add dynamic data, parse xsl and substitute data.
Although this works fine, it eats up too much memory.
Is there any alternate solution ?
I do not want to write html code in ja...
How to create JNLP file for a java web application?
I have a java program that I ultimately want to deploy it on the web.
I started off creating a jar file from bunch of classes:
jar cfe tbi.jar trail1modified
trail1modified.class
InitialKeypad.class
InitialKeypad$1.class
InitialKeypad$2.class
InitialKeypad$thehandler.class
InitialKeypad$thehandler2.class
InitialKeypad$thehandler3.class
InitialKeypad$thehandler4.class
Keypad...
java - create a server application having gui
I have to create an application having a GUI. my application has to work as a server. When it starts, it has to accept all the incoming connection and write the output in a JTextArea. my problem is where I have to create the ServerSocket ss = new ServerSocket(port_number) and the method ss.accept in the way I can accept connections. I tried to create in the main constructor of my gui but being
java - LWJGL - How to create a button to close the application
I have made it open a full screen window but now how can i create a button to have it exit the application?
Also, do you know any good tutorials to learn. I can't seem to find many?
Lastly can i use the opengl code that i learn to work with java in c++ or is that opengl completely different?
This is the code i have:
package game;
import static org.lwjgl.opengl.GL11.*;
import org.lwj...
java - guide to create "Hello world" web based application?
if I have let's say "Hello World" java application with normal interface, what are the steps needed (in general) to create a web interface for the application so I can run it and access it through the browser ?
public interface HelloWorld {
public void init();
}
public class Hello implements HelloWorld {
public void init() {
// Do simple stuff
}
}
I need to be able to ...
java - How to create custom volume for my application
I'm trying to create a custom volume button, but I have not stopped with any Statute or any ideas to help me develop it.
I go to publish my question after having searched a lot on the net and have not found anything.
What I do is something like this:
or like this:
java - Can't create log4j log file inside my web application
i am using log4j as my logging library, and i want the generated log file to be inside my web application, so following are the jars i am using:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId...
java - How to create exe file of javafx application
I have created a desktop application using javafx. It uses the database of mysql. And by using Netbeans I packaged the application into running jar.
Now I want to distribute the application as a exe file for the windows users. Now my problem is how to create exe file from the jar and how that exe will connect with the database.
windows - IE6 generated strange worksheet name when doing export from java application
I am encountering error like
test(10)[1].csv file cannot be found at
C:\Documents and Settings\Ron\Local Settings\Temporary Internet Files\Content.IE5\PQ0STUVW
When trying to do export of CSV file using the following codes.
Anyone have any idea what could be wrong? This issue does not occur in IE7 / Firefox and is only specific to IE6.
response.setContentType("applicati...
c# - Embedding Flash Player in a C++ or Java application?
I would like to embed Flash Player directly inside a C++ or Java application.
I found an article that describes how to do this for C#:
http://www.adobe.com/devnet/flash/articles/stock_history03.html
Unfortunately, I have no experience with C#, COM or ActiveX. I need someone to translate this code to C++, allowing ...
java - How best to implement user selectable variables in web application
I have a Java based web-application and a new requirement to allow Users to place variables into text fields that are replaced when a document or other output is produced. How have others gone about this?
I was thinking of having a pre-defined set of variables such as :
@BOOKING_NUMBER@
@INVOICE_NUMBER@
Then when a user enters some text they can specify a variable inline ...
java - BIRT in a desktop application
Did someone ever used a BIRT report in a desktop application. I'm comming from the .NET environment and there you can use Crystal Reports to show reports in desktop apps. Is this possible with BIRT too, without having to set up a server environment?
Can you give me some advice how to reach this goal?
Thanks in advance.
which library better for faster java application swt or swing?
which library better for faster java application swt or swing?
java - Which is the best Open source application server?
java - Access spring bean that is exposed using http invoker from GWT application
Can I access spring bean that exposed using http invoker (server) from GWT application (client)?
If so is there any example / tutorial for that?
How to close a Java Swing application from the code
What is the proper way to terminate a Swing application from the code, and what are the pitfalls?
I'd tried to close my application automatically after a timer fires. But just calling dispose() on the JFrame didn't do the trick - the window vanished but the application did not terminate. However when closing the window with the close button, the application does terminate. What should I do...
java - How best can I isolate my application from an unreliable database?
I have a Java SOAP data service which sits on top of a Sybase database which, for reasons out of my control, has unreliable performance. The database is part of a vendor package which has been modified by an internal team and most of the issues are caused by slow response times at certain times of the day.
The SOAP service provides data to a calculation grid and when I request data, I need the response time to be ...
java - Netbeans GUI Designer & Fixed-Size Application Panels
I'm having a problem, creating a fixed-size overall panel for a touchscreen GUI application that has to take up the entire screen. In a nutshell, the touchscreen is 800 x 600 pixels, and therefore I want the main GUI panel to be that size.
When I start a new GUI project in NetBeans, I set the properties of the main panel for min/max/preferred size to 800 x 600, and the panel within the 'Design' view changes size. ...
Still can't find your answer? Check out these amazing Java communities for help...
Java Reddit Community | Java Help Reddit Community | Dev.to Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)