new to Corona - experienced dev

Hi all,

I’m new to Corona, and phone development in general, but I’m an experienced developer and looking at getting into phone apps.

If you want to avoid the back-story, go down two paragraphs :slight_smile:

I’m a C/C++/Java developer with about 17 years commercial experience in various fields. I’m also an Android fan and recently purchased a Dell Streak 5in mini tablet running 2.2 (FroYo). I couple of weeks ago I grabbed the Android SDK and Eclipse + Android plugin and had a play. It was familiar, being Java, and seemed like quite a good model, but I soon lost interest. I’ve learned many languages/API’s/SDK’s/frameworks etc over the years and learning another just made my eyes glaze over. The other day a workmate mentioned Corona (after the BubbleBall story) but I didn’t see any Windows support (I only use Windows). Anyway now there is the Windows beta, I’m looking at it again. I’ve done some reading on Lua, and while I haven’t used it before, it looks simple enough. Same with Corona.

My main question is , what would be the recommended path for an established developer to take to get into Corona development? Should I just go through all the newb articles/tutorials, or go straight to one of the ‘frameworks’ that I see people have come up with? Should I go straight into OO concepts, which of course I’m no stranger to, or start simply? If the former, could someone recommend such classes or a framework? I guess I’d try my hand at a simple game first, but I’m not ruling out ‘other’ apps as well. Should I try and clone a simple existing game (for practice)? Maybe put my name out there for a free phone app dev and learn as I go :slight_smile: I’m not a Mac user, and only have an old (PowerPC) Mini in the house which can’t be used for the purpose of iPhone apps, so I was initially targetting Android. I also don’t have an iPhone or iPad. (*However* given the larger market for iPhone, I could be swayed. But that’s another topic).

Thanks in advance for any pointers and sorry for the ramble!

programmer
[import]uid: 23949 topic_id: 5620 reply_id: 305620[/import]

If you’ve had experience coding before you should just fall into Lua/Corona. Funny that you ask this question, I’ve been trying to work on a training outline for programmers. I would recommend:

  1. Reading through the APIs and cherry picking some functions that you think look interesting it’s useful just to read before you event start so you know what is available to you.

  2. Build sandboxed apps which each just do “one thing”:
    LUA

  • Understand lua tables and how they can be indexed and referenced
  • Lua variable polymorphism
  • Understand how Lua is able to return more than one variable from a function call
  • Variable scopes inside functions/libraries/loops
  • How to store functions inside lua modules which are required/imported
  • Importance of checking for nil in Lua and using nil to clear memory
  • How to check texture memory usage and lua garbage collection
  • Skim through the available Lua functions from lua.org just to get an idea of the string and math functions available to you

CORONA

  • Draw/load images to screen
  • Draw text to screen and update with an external event
  • Trigger touch/tap events
  • Use UI button (separately from above)
  • Trigger something with a frameevent
  • Perform image object transitions with transition.to; do multiple variations
  • Use variations of the timer.delay function
  • Use and manipulate display groups (IMHO this is one of the key aspects of corona)
  • Understand how setreferencepoint affects image coordinate positioning
  • Understand the difference and how to access Resource/Documents/Temp directories with file paths
  • Read and write files to the R/D/T directory types

Step 2 needs can be achieved with a combination of reading docs/samples/code exchange - not just anyone of them. Just search for references or samples that help you achieve what you’re trying to do.

Once you have done your little sandbox test apps you have a reference to refer back to when you get started on your first app.

“My” experience was: don’t bother writing an app until you understand the fundamentals, you’ll just realise later that you were doing it all wrong and have to rewrite it from scratch. [import]uid: 11393 topic_id: 5620 reply_id: 19179[/import]

Hey thanks for the detailed answer. I’ll pick this apart and let you know how I go. I have read Lua and Corona docs, browsed sample code, etc. and I’m going to go through some basic stuff. Your guidelines will help direct me, thanks! [import]uid: 23949 topic_id: 5620 reply_id: 19180[/import]

His suggestions are pretty good. I would agree with that workflow of doing lots of little tests and gradually working your way up to deeper concepts. Note that an experienced programmer can probably work through all of the Lua items in an afternoon; if you happened to be experienced in graphics programming (especially AS3/Flash, which I was) then you could get through the Corona items he listed on the next day. You probably don’t need to read the newbie tutorials in-depth, but do at least skim them so that you’ll know where to look stuff up when you need to look stuff up later.

I also started using Corona after already been an experienced developer, and what I already knew from other programming languages made learning Lua a snap. My previous experience was mostly doing graphics programming, and especially using AS3/Flash, so I picked up most of Corona’s API easily too. Unfortunately it doesn’t sound like you’ll have that second head-start, so moderate your expectations accordingly.

Some specific comments on bedhouin’s list:

Understand lua tables and how they can be indexed and referenced
funny you should mention that:
http://developer.anscamobile.com/code/tables-lua-dictionaries-and-arrays

How to store functions inside lua modules which are required/imported
You might want to look at my object oriented example, but honestly an experienced programmer may be better off figuring this stuff out on their own without being biased by my way of doing things:
http://developer.anscamobile.com/code/object-oriented-sample-game-framework

Importance of checking for nil in Lua and using nil to clear memory
I don’t think it is very important actually. Nil-ing variables is recommended to newbies because it is simple to remember, but if you are already used to garbage collection in Java then Lua works in pretty much the same way:
http://developer.anscamobile.com/forum/2011/01/14/how-do-i-tell-if-my-game-leaking#comment-16568

How to check texture memory usage and lua garbage collection
In these threads I learned of collectgarbage(“count”), a very useful command for tracking Lua’s memory usage:
http://developer.anscamobile.com/forum/2010/12/27/leak-or-me-not-getting-it
http://developer.anscamobile.com/forum/2011/01/14/how-do-i-tell-if-my-game-leaking#comment-16561 [import]uid: 12108 topic_id: 5620 reply_id: 19237[/import]

Extremely helpful posts, thanks. Trust me I will be going through the info and links, but slowly due to the realities of life. How many of you do phone apps full time? I guess it’s something i can do on the side while keeping my day job.

Back on topic, it’s worth noting I have no experience with flash, etc. which might have helped, and basically no web development. I do have some graphics background, and I’ve done quite a few UI’s. Anyway I hope to get some time on this and see how I go.
[import]uid: 23949 topic_id: 5620 reply_id: 19311[/import]