Saturday, April 9, 2011

Setting up iMac for Mobile development with Corona SDK

I have officially made the move to MAC, of course I still use my Windows stuff on a VM utilizing parallels, but this post is about the feat of strength to stand up my mobile development environment on this new foreign machine to me and it ends with a successful deployment to my Android phone...

My main reasons for making is the switch is that I have decided on using Corona SDK for my mobile middleware.  I have done native Android development, but to pick up yet another language to port to iOS is just not very appealing.  With Corona, I can use Lua scripting and write my code once and deploy to both Android and iOS - perfect!

The toolsets I use:

  • Eclipse
    • Helios edition
    • Android SDK
    • Java Runtime
    • LuaEclipse (Lua 5.1 plugin for Eclipse)
  • XCODE - developer tools for mac and needed for iOS development
  • Corona SDK
Lets begin...
  1.  Install Eclipse    (This step is pretty straight forward, no surprises, just pick the version you want)
  2. To get Lua integrated with Eclipse, you have some hoops to jump through, i relied heavily on this post which was quite helpful.  LuaEclipse  The main catch is that you are going to need XCODE installed in order to be able to use macports to grab the Lua interpreter and profiler that you will subsequently setup within Eclipse.  (Keep in mind if you are working with Corona, any text editor will do since their are limited editors with text highlighting and auto completion for te Corona API's, but for my taste I want to continue working within Eclipse as much as possible in case I go native on android I'm good to go.)  Again, trying to use as many common tools and write once approaches as possible to get on both Android and iOS.
  3. Pull down the Android SDK - not bad on this step just follow the steps on Android SDK Install Guide
  • There's a step after installing luarocks from macports where you need to allow luarocks to run as a privileged user - this was foreign to me and later I found to just get to the file in Finder and click the little pad lock and enter my master password, change the permission and lock it back down - not too bad
  • This is more of a Corona thing, but when I got my first application published to my phone I couldn't get the correct icon to display in the applications menu, this is because they need to be correctly sized and named beginning with Android 2.2 as such:
    • Icon-hdpi.png  72x72 pixels
    • Icon-mdpi.png 48x48 pixels
    • Icon-ldpi.png 36x36 pixels
    • Also, for earlier versions you need an icons folder in your solution and just an icon.png file of 48x48
Well that's it for now, after a couple hours pulling all this together I have a nice workflow environment that I feel at home with to code for both Android and iOS utilizing the Corona SDK for emulating and building and Eclipse for my Lua script editing.

No comments:

Post a Comment