Getting started building apps for an absolute beginner.

Codename One turned out to be a bust.  It’s been two days since I submitted my simple ‘hello world’ app to them and its status still says ‘building’.

So I’ve been looking around at other alternatives.  There’s nothing free – nothing, that is, except PhoneGap.  Everyone talks about phonegap on all these app-building sites, and they always say ‘poor performance’ so I dismissed it out-of-hand.

But what is phonegap?  I thought it was a developing environment, but really its a service that turns web-based code into something that can run on Iphones or Android phones.  Any phone, really.  It is a compiler.

There’s a fundamental problem with any app-building endeavor: you need a computer.  You cannot code or (easily) test your code on your phone.   It’s too hard to get the app onto your phone.  Especially Iphones.  Apple has made it so a Mac is required to compile any app for Iphone.  Why?  Because they are greedy.  They have made it so you have to use a certain program, and only that program, to compile Iphone apps.  And this requires you to buy a developer license for $99 – even for a simple hello world app.

Google phones are sightly more developer-friendly, but it still a pain to get an app on the phone, and you still need a computer ie. something with a keyboard.  This creates a new problem:  Finding a way to make and test an app on your computer.  Computers are different operating systems.  Even a Apple Mac computer uses a different operating system (OS X) than its Iphone (iOS).  So to make any app on your computer, you have to basically have some kind of phone emulator.  And this is not an easy thing to ask for.  Hence, anyone who made one also wants you to pay.

Codename one promised to be free, and it is, until you need to get it to the phone.  You have to compile it.  And only they can compile projects created with Codename one.  Gotcha!  They have a free service where you submit it online, but its limited to 100 uses, and as I have just reported, it takes too long for a simple compile.

So there must be a new solution, something to run and test code on a computer, and a way to compile it and get it to your phone.

But wait – why should someone have to use a completely new developing environment to run code, when such a thing exists already, on almost any computer?  What am I talking about?  Web browsers can run javascript, which requires no compiler!  Just a text editor and a web browser is needed to start writing and testing code.

Phonegap realized this and made a way to turn javascript code into phone code.  I didn’t need to learn a new environment – I could just use javascript.  So that’s what I did.  I made a simple app using javascript and submitted it to phonegap’s build site.  I had to register, but it was free and took less than a minute to get my app compiled.  Really.  Yes, you heard that right, its already done.  One day.  That’s how long it took me to write a game and get it compiled for my phone.

There’s a nice javascript wrapper made especially for games, called Phaser.  It took less than an hour to copy the examples into my own app.  Here is my app.  You may play it.  Since it is javascript it runs on any browser.  Aren’t I awesome?!  Ok, well, I cheated a little by copying the code from here, but it was a great way to learn and I think even people who have never coded could understand it.  It almost reads like english.

I zipped up the code and uploaded it on the phonegap site, and voila, it automatically compiled it for every phone operating system it could (meaning everything except Apples IPhone).  WOOHOO!

Problem is, I don’t have a phone to run it on!  I will try to get ahold of a cheap android phone and see if it works.

As for performance issues, from what I understand, it makes an app that runs through the webbrowser.  Basically an emulation.  But I see no problem with that.  All the mobile apps ive seen are low-intensity.  I’m not making a first-person shooter.  I’m trying to make a chess app.  What do I need optimized speed for?  yes, I want it to be fast, but I can easily rewrite my code if need be.  And there are now services out there that take your javascript code and turn it into native, optimized code for iphone or whatever.  This one is called CocoonJS and looks very exciting.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.