image_thumb3

After mocked up my main interface and define my feature list, I evaluated the things I can and cannot do with the current Corona SDK (I can’t get access to the beta SDK as I am using the trial version). My list of CAN’T do includes:

– no support for SQLLite database (this is crucial in my case as I will have a list of places that must be available, even if the user is not connected) – I am addressing this with data in a text file. This is not the way I would like to implement but, considering I will have only hundreds of records, it will work;

– no MapKit integration, meaning I will not be able to render a map in a small part of the screen (when the user taps “see in the map” I will have to render a full HTML file showing the map, over the main screen;

– no native components nor keyboard available in landscape mode. This is hard, specially because I was thinking to address iPad as one of my targeting platform (Apple requires that the iPad interface works both in Portrait or Landscape);

– no email integration (I can’t create the email’s body programmatically);

Ansca has published its roadmap for Corona but, although several topics seems to be in their list, dates are far from final (in most cases they only say Q2/Q3, meaning something may be available from April to September– this is not the best way to get new customers to their platform!)

Knowing my limits, I read all Corona documents, plus the Lua official book and started to code. Some findings at this moment (please feel free to correct me if I missed something):

– You can’t find the same number of Lua samples in the web as you do for languages like Javascript or PHP. It is hard to move on when you are stuck;

– Lua book is not updated (the live code is different than the code printed);

– Corona does not implement the full Lua 5, meaning some functions are not available (after hours trying to work with dofile, for example, I figured out this is not available in Corona);

[Update: Scott’s comment below confirms that all Lua 5.1 is implemented in Corona. Thanks for this info. I hope Ansca can create a table with the functions not available due security issues with the iPhone SDK]

– Because Corona does not have integration with SQLLite yet (Lua  can do that), I have to work a lot with arrays, a concept Lua does not have – the closest thing is tables. Problem is, tables are much more difficult/confuse to use than arrays (if you are familiar with arrays). Basic functions like arrayName.count (counts the number of elements in an array) do not exist in Lua tables (yes, in order to count how many elements I have in an array, I had to create a function who reads element by element and return the number found – crazy!).

[Update: Clearly I missed this info. There is a way to count arrays without the function I have used. In fact is is much simpler than I even imagined: to count the number of elements in a table called “places”, all you have to do is: #places]

Although I expect a miserable life in the next weeks, developing in a language I do not know, without many examples to search, plus the fact Corona SDK documents could be improved (also it is oriented to games instead of apps), I will keep you posted on my progresses.

[Update: I agree that Corona offers lots of good examples and samples but I still think they could improve their documentation.]

Why am I doing that? Because I really think it is going to be easier to learn Lua/Corona plus developing my features according the limitations, than to learn Object-C. Time will tell if I am right or wrong (and you are going to know from here).

BTW, I have written a few functions I will comment in the next postings.

Alex