{"id":5,"date":"2011-10-13T03:15:53","date_gmt":"2011-10-13T03:15:53","guid":{"rendered":"http:\/\/ramblingprogrammer.com\/?p=5"},"modified":"2013-03-09T18:55:24","modified_gmt":"2013-03-09T18:55:24","slug":"iphoneandroid-sdks","status":"publish","type":"post","link":"https:\/\/ramblingprogrammer.com\/?p=5","title":{"rendered":"iPhone\/Android SDK&#8217;s"},"content":{"rendered":"<p>I wanted to work on an iPhone\/Android port of <a href=\"http:\/\/www.homebrewsoftware.com\/html\/arrowantics.htm\">Arrow Antics<\/a>; one of my older games.  The original game was written using <a href=\"http:\/\/www.libsdl.org\/\">SDL<\/a>, but the current state of SDL 1.3 is still a bit flaky and not ready to release products with.<\/p>\n<p>I started looking at various 2D iPhone solutions.  The two most popular 2D iPhone SDK&#8217;s appear to be <a href=\"http:\/\/www.anscamobile.com\/corona\/\">Corona<\/a> by Ansca, and <a href=\"http:\/\/www.cocos2d-iphone.org\/\">Cocos2D<\/a>.<\/p>\n<p><strong>Cocos2D<\/strong><br \/>\nCocos2D has an Objective-C based API.  Personally, if I wanted to use Objective-C I would just code directly to the iOS SDK.  However, for less experienced programmers there is a lot of value in not having to write the functionality included in the Cocos2D SDK.  So, for me, I quickly ruled out Cocos2D.<\/p>\n<p><strong>Corona<\/strong><br \/>\nCorona SDK is a Lua based solution that supports iOS based apps (iPhone\/iPad) and Android based apps (Droid, NexusOne, myTouch, GalaxyTab).  Since all of the app logic is written in Lua, it is a &#8220;write once, run anywhere&#8221; type solution; at least for iOS and Android based systems.<\/p>\n<p><strong>Corona Pros<\/strong><br \/>\nObviously the biggest strength of Corona is that it is a cross platform solution.  If you are only targeting iOS then you can go with the iOS SDK or Cocos2D.  However, if you think that you might want to deploy your app on other platforms then you will want a solution like Corona.  There are a lot of nice features that Corona supports, including physics using Box2D, Facebook Connect, OpenFeint support, and most importantly native device features.<\/p>\n<p><strong>Corona Cons<\/strong><br \/>\nThe most obvious drawback to Corona is the lack of a UI Layout tool.  If you want to place images, buttons, widgets, etc on the screen you have to do it all in Lua like this:<\/p>\n<p><code><br \/>\nlocal helpGroup = display.newGroup()<br \/>\nlocal backgroundImage = display.newImageRect( \"Background.png\", 480, 320 )<br \/>\nbackgroundImage.x = 240; backgroundImage.y = 160<br \/>\nthisGroup:insert( backgroundImage )<br \/>\n<\/code><\/p>\n<p>Sure, this is only a few lines of code.  However, it means you have to do something like this for EVERY display object in your app.  Why not have a layout tool that writes out a layout file in XML or JSON?  Then for each screen in your app you could just load the data file and it would create your display objects and add them to the display group.<\/p>\n<p><strong>Conclusion<\/strong><br \/>\nI will no doubt find other strengths and weaknesses with Corona as I continue the port of Arrow Antics.  Look for more info soon.<\/p>\n<p><em>P.S.: Like this article?! Want to support?! Be free to donate with bitcoins!<\/em> <strong>19r39vr2zs14aHW6DMNtPjmRga9xERQTTP<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to work on an iPhone\/Android port of Arrow Antics; one of my older games. The original game was written using SDL, but the current state of SDL 1.3 is still a bit flaky and not ready to release products with. I started looking at various 2D iPhone solutions. The two most popular 2D <a href='https:\/\/ramblingprogrammer.com\/?p=5' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,9,3,4,10],"tags":[],"class_list":["post-5","post","type-post","status-publish","format-standard","hentry","category-android_dev","category-corona_sdk","category-development","category-iphone_dev","category-lua_dev","category-7-id","category-9-id","category-3-id","category-4-id","category-10-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/ramblingprogrammer.com\/index.php?rest_route=\/wp\/v2\/posts\/5","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ramblingprogrammer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ramblingprogrammer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ramblingprogrammer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ramblingprogrammer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5"}],"version-history":[{"count":5,"href":"https:\/\/ramblingprogrammer.com\/index.php?rest_route=\/wp\/v2\/posts\/5\/revisions"}],"predecessor-version":[{"id":95,"href":"https:\/\/ramblingprogrammer.com\/index.php?rest_route=\/wp\/v2\/posts\/5\/revisions\/95"}],"wp:attachment":[{"href":"https:\/\/ramblingprogrammer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ramblingprogrammer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ramblingprogrammer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}