Sunday, October 7, 2012

Taming the Cross-Platform Craziness

So, "developing for iOS is not as easy as it could be" is something i hear a lot from iOS developers that I know and have talked to in the past.  The reason always seems to stem from the fact that to develop in iOS you have to write your code in Objective-C.  I've heard Obj-C called many things in the past ( "powerful" , "well thought out", and even, "what C++ should have been") but "easy" is not one of them.

This past week I have spent a fair amount of time setting up and getting to know the Corona SDK.  Corona's claim to fame is that it allows a developer to code an app in the Lua language and it does the nasty business of converting the code to native behind the scenes.  A really nice advantage that Corona has over other attempts to do such things is that it also supports conversion to other platforms (Android, Kindle, etc...) so it allows writing once and deploying on multiple platforms.

I had anticipated a tedious and lengthy install process but was pleasantly surprised to discover that installation was super simple and went without incident.  I know others in the team had noted that Corona needed the 32 bit version of the Java JRE installed to run.  I'm running the Java 7 64 bit JDK (which includes the 64 bit JRE) and have had no issues though i'm not sure why.

Corona on Windows starts the Corona Simulator and the Corona output terminal together. Corona on Mac OS X allows starting just the simulator if one wishes, otherwise starting the Corona Terminal also starts the simulator (the terminal is used to show the developer app output and debug info).

Once installed the next step was verifying my Corona developer credentials (you need a corona account to use the SDK but it is free and is quickly becoming standard practice).

The last thing to do was to start writing code.

Corona supports you using whatever text editor or IDE you choose.  I tend to switch between Sublime Text 2 and IntelliJ IDEA 11 (free edition) with the Lua plugin.  I really like Sublime Text 2 because it never "gets in the way".  Other developers will know what I mean.  However, when I'm starting out with a new language I love having code-completion (intellisense) to help guide me in doing what i want to do instead of having to look up the API every time.  Also, I like the IDE's ability to show on the fly errors and warnings.  This is just the way I like to work, everybody is different and Corona doesn't care what you use to write the Lua code.

Speaking of Lua; so far I really like it.  From the official Lua site:


"Lua is a powerful, fast, lightweight, embeddable scripting language.
Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping."

It's still early but thus far i have found Lua to be all that it claims.

Next week I'm gonna continue to continue learning Lua and continue poking around the Corona framework.  I have the tasks of researching any social network integration capabilities that Corona might support to check on feasibility.  I may even begin implementation if it's not going to be too difficult.   I'm also going to research some open source Corona libraries that are available that are supposed to make app development even easier by packaging commonly used methods.  Some basic game sprite creation is also on my plate but I'll have to see how far I get with he other stuff.

No comments:

Post a Comment