Friday, August 19, 2011
Java for IOS
Java has always been my choice drink and programming language of choice. So when I heard that apple refuses to allow integration of Java on their handheld devices, I was thoroughly upset. However, with a jailbroken device, I knew there must be some way, some get around. With a new motivation, Google at my fingertips, and a cup of freshly brewed joe, I searched and came across OpenJava -with their purpose being to reach low power devices. Then, I found what I was looking for. iphoneroot.com had the answer. However, the article and tutorial seemed a little outdated, but I managed. I opened up cydia and searched keyword:"java" and found nothing. Supposedly saurik had it in his source, so I scrolled through the source. Nothing. An inspiration suddenly flowed through my drink into me and caused an epiphany. I went to (cydia) Manage>Settings>Developer. Searched again for java and what do you know! There it was! So after installing JamVM, Java SQLite, Jikes, JocStrap, and everything that came with, I was overjoyed in the prospect of enhancing this touchscreen toy. I opened up the app that came with for java examples, and it failed to open...So I tried again...and again...and again...nothing. Realizing that developer setting means the apps are commandline tools, I opened Terminal - which has never worked for me previously. More research, more java, led me to http://cydia.xsellize.com, a repository with an updated MobileTerminal (should also be on the code.google.com project site if you want to ssh into it), I replaced my old one and it worked! I wrote a simple HelloJava application, compiled it via Terminal (jikes -cp /usr/lib/rt.jar)and ran it (java HelloJava) and admitted success. :] Now for me to make some worthwhile programs for my iPod and hopefully see if a GUI is within JamVM's capabilities. The Java applications on cydia were supposed to bind Objective C and Java in a sense, but I'll see about that next time.