First steps with iPhone and Java...
Posted by brunogh on May 25, 2008 at 09:49 PM | Comments (9)
When I was at JavaOne, I sold my soul to devil: I bought an iPhone. Here in Brazil, there is no iPhone being officially selled yet.
Let's start having fun and playing with Java on it:
1. Unlock your iPhone. Babies can do that before they say mama. More information at Zibri's Blog.
2. Make it useful: Install Cydia (front-end for Debian APT) to substitute default Installer application. In Installer, go to the Source option, click Edit, Add http://apptapp.saurik.com, Done and then Refresh. Then go to Install option, search for Cydia Installer and install it.
3. After that, open Cydia and search for the word Java, there are a few stuff part of the iPhone/Java package available in Development menu. You are able to make graphical applications using the UI Framework, which is possible due to JocStrap, a Java/Objective-C bridge. Install iPhone/Java that will bring the necessary stuff (JamVM, etc) for this simple demo. Also, later try to install Jikes, a compiler for version 1.4 and fastjar, an alternative for running jars, because I could not test them yet.
PS: Install OpenSSH in your iPhone and then connect your laptop on its server. Also, install Boss Prefs to be able turn SSH on/off. Finally, do not forget to change you root password using passwd, default password is alpine.
I have created a simple Hello World app into NetBeans. Then I have compiled it, tranfered to iPhone and runned (via SSH).
Code:
public class Main {
public static void main(String[] args) {
System.out.println("Hello World... in Java");
}
}
Screenshot:
java_iphone.png
Community will bring ME world into iPhone as well. The answer for this is phoneME Advanced. Keep and eye and join the mailing lists! As you can see, there are some very nice projects going on!
Have a nice and funny week!
Bruno Ghisi