<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Ansca Mobile Blog</title>
	
	<link>http://blog.anscamobile.com</link>
	<description>A resource for Corona developers</description>
	<lastBuildDate>Wed, 16 May 2012 02:09:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AnscaMobileBlog" /><feedburner:info uri="anscamobileblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://superfeedr.com/hubbub" /><item>
		<title>Corona Engineering: Next release and more</title>
		<link>http://feedproxy.google.com/~r/AnscaMobileBlog/~3/aa2BTrDfDf8/</link>
		<comments>http://blog.anscamobile.com/2012/05/corona-engineering-next-release-and-more/#comments</comments>
		<pubDate>Wed, 16 May 2012 02:09:24 +0000</pubDate>
		<dc:creator>Walter</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Corona SDK]]></category>

		<guid isPermaLink="false">http://blog.anscamobile.com/?p=15993</guid>
		<description><![CDATA[...]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been busy doing some in-house spring cleaning, so I wanted to take a quick break to give you an update.</p>
<p><strong>Bugs</strong></p>
<p><a href="http://blog.anscamobile.com/wp-content/uploads/2012/05/Screen-Shot-2012-05-07-at-1.37.05-PM.png"><img class="alignright size-medium wp-image-15995" title="Bug base preview" src="http://blog.anscamobile.com/wp-content/uploads/2012/05/Screen-Shot-2012-05-07-at-1.37.05-PM-300x179.png" alt="" width="300" height="179" /></a>In my <a href="http://blog.anscamobile.com/2012/04/real-time-engineering-bug-fix-cycle-begins/">last post</a>, I talked about making our bugs publicly available. It&#8217;s not ready for prime-time, but I did want to give you a preview (see screenshot).</p>
<p>We structured it so that you can see the recently closed bugs, the ones in our queue, and the ones in our backlog.</p>
<p>This way you&#8217;ll be able to see if the issues as the Corona engineering team sees them. If you&#8217;ve submitted a bug and it&#8217;s been verified as an issue, you&#8217;ll now be able to see where it sits in the engineering queue.</p>
<p>We&#8217;re still working some kinks out so in the mean time, let us know what you think!</p>
<p><strong>Next Stable Release</strong></p>
<p>We officially kicked off our bug fix cycle three weeks ago. For those of you keeping track of daily builds, we&#8217;ve been making steady progress on some of the most annoying bugs and regressions. We have closed over 70 high priority bugs, and we think we&#8217;ve made great progress in daily build quality. We really do appreciate the feedback you guys have been giving us on them.</p>
<p>We are still fixing bugs this week. At the end of this week, we will have a candiate for a public release. After that, we will be doing final testing to get to an official public release. We expect that to happen within 1-2 weeks.</p>
<p><strong>More Stable Daily Builds and Frequent Public Releases</strong></p>
<p>Some of you may be wondering what happened to the 2-on-2 schedule (2 weeks of features followed by 2 weeks of bug fixes). It&#8217;s something we&#8217;re very serious about. What we decided to do was put the feature cycle on a holding pattern, and instead, extend the bug fix cycle longer than normal. Why? Because it was important that we have a solid release out before we can make the 2-on-2 cycle a working reality. (For the math geeks, the 2-on-2 is the &#8220;inductive&#8221; step; the solid release is the base case.)</p>
<p>At the end of each feature/bug 1 month cycle, we will be &#8220;blessing&#8221; a daily build, meaning you should feel very confident about shipping your app with that particular build. In addition, every 3 months, we aim to deliver an official public release. In either case, you&#8217;ll be able to more comfortably take advantage of all the latest Corona features.</p>
<p><strong>Roadmap?</strong></p>
<p>Yes, the elusive roadmap. Next week, we&#8217;re going to put a static, preliminary version of our roadmap in our forums. It will be open to your feedback. Soon after that, we&#8217;ll be taking this one step further and provide a way for you to vote on the features you think are important. We&#8217;re still working out the details but something along the lines of subscribers being able to select the top 3 features they want the most.</p>
<p style="text-align: center;"><strong>* * *</strong></p>
<p>I know a lot of you are passionate about Corona. Sometimes we get pretty raw feedback publicly or privately. Other folks shy away from that, but I want you to keep &#8216;em coming!</p>
<p>We&#8217;re all trying to do the same thing which is make Corona the best development platform on the planet!  Just keep in mind that sometimes it&#8217;s a game of inches <img src='http://blog.anscamobile.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/AnscaMobileBlog/~4/aa2BTrDfDf8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.anscamobile.com/2012/05/corona-engineering-next-release-and-more/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.anscamobile.com/2012/05/corona-engineering-next-release-and-more/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=corona-engineering-next-release-and-more</feedburner:origLink></item>
		<item>
		<title>Handling Corona System Events</title>
		<link>http://feedproxy.google.com/~r/AnscaMobileBlog/~3/qjilRgozqXo/</link>
		<comments>http://blog.anscamobile.com/2012/05/handling-corona-system-events/#comments</comments>
		<pubDate>Tue, 15 May 2012 15:00:09 +0000</pubDate>
		<dc:creator>Jonathan Beebe</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.anscamobile.com/?p=15965</guid>
		<description><![CDATA[...]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.anscamobile.com/wp-content/uploads/2012/05/corona_event.png" alt="Corona System Events" style="float:right;padding-left:10px;padding-bottom:10px;margin-top:-25px;margin-right:-15px"/>When developing applications, it&#8217;s important to handle scenarios that occur as a result of the user interacting with your game in as many different ways possible. It&#8217;s equally as important to handle scenarios that occur as a result of &#8220;system&#8221; events, whether they are explicitly triggered by the user or not.</p>
<p>Things that immediately come to mind are things that cause your app to become &#8220;suspended&#8221; such as the user receiving a phone call, or pressing the &#8220;home&#8221; button on their device (your app is still running in the background, but in a suspended/paused state). What about when the user comes <em>back</em> to your app while it is suspended, or when your app exits completely?</p>
<p>All of those things are handled by &#8220;system&#8221; events in Corona, and that&#8217;s what I&#8217;ll be going over today.</p>
<p><span id="more-15965"></span></p>
<h4>Event Listener</h4>
<p>Before you can start monitoring system events in your Corona app, you need to set up a listener function, and add a &#8220;system&#8221; event listener. If you&#8217;re not familiar with events in Corona, I suggest you read <em><a href="http://blog.anscamobile.com/2011/06/the-corona-event-model-explained/">The Corona Event Model Explained</a></em> document before continuing.</p>
<p>The code below&mdash;commonly placed at the end of <em>main.lua</em>&mdash;shows how to setup your event listener, and also add it to the global Runtime object (the only object that can listen for &#8220;system&#8221; events).</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local function onSystemEvent( event )<br />
<br />
&nbsp; &nbsp; -- Test for different event types here<br />
<br />
end<br />
Runtime:addEventListener( &quot;system&quot;, onSystemEvent )</div></div>
<p></p>
<h4>applicationStart</h4>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local function onSystemEvent( event )<br />
&nbsp; &nbsp; if event.type == &quot;applicationStart&quot; then<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; do_something()<br />
<br />
&nbsp; &nbsp; end<br />
end</div></div>
<p></p>
<p>The above code example shows how to test for the &#8220;applicationStart&#8221; event type in your system event listener.</p>
<p>You app will receive an &#8220;applicationStart&#8221; event when your app launches (from a closed/cold state, not a suspended state), and after the code in <em>main.lua</em> has executed.</p>
<h4>applicationExit</h4>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local function onSystemEvent( event )<br />
&nbsp; &nbsp; if event.type == &quot;applicationExit&quot; then<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; do_something()<br />
<br />
&nbsp; &nbsp; end<br />
end</div></div>
<p></p>
<p>The &#8220;applicationExit&#8221; system event is dispatched just prior to your app quitting (e.g. not suspending, but fully closing). This can occur from the user explicitly, or if the operating system&#8217;s task manager tells the app to close for whatever reason (usually due to your app being the least recently used, in low memory situation).</p>
<p>Things that this event is most commonly used for is to do any last-minute data saving, closing open database connections, etc.</p>
<h4>applicationSuspend</h4>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local function onSystemEvent( event )<br />
&nbsp; &nbsp; if event.type == &quot;applicationSuspend&quot; then<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; do_something()<br />
<br />
&nbsp; &nbsp; end<br />
end</div></div>
<p></p>
<p>I touched on this briefly already, but if the user receives a phone call, or anything happens that causes the user to have to switch <em>out</em> of your app on their device, or if the user presses the &#8220;power&#8221; button and puts their device to sleep, your app will go into a suspended state (but will not quit).</p>
<p>Prior to going into this suspended state, an &#8220;applicationSuspend&#8221; event will be dispatched, which gives you a chance to do things such as pause the game (so the user will be at the pause screen when they come back, instead of on the verge of being defeated!), mark the time (for any time-tracking functionality), pause/stop any timers and/or transitions, etc.</p>
<h4>applicationResume</h4>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local function onSystemEvent( event )<br />
&nbsp; &nbsp; if event.type == &quot;applicationResume&quot; then<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; do_something()<br />
<br />
&nbsp; &nbsp; end<br />
end</div></div>
<p></p>
<p>Speaking of your app being suspended, you also have a chance to &#8220;do something&#8221; whenever your app <em>comes back</em> from the suspended state, which is where the &#8220;applicationResume&#8221; event comes in.</p>
<h4>Putting it all together</h4>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local function onSystemEvent( event )<br />
&nbsp; &nbsp; if event.type == &quot;applicationStart&quot; then<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; -- this block executed when application launches (after main.lua)<br />
<br />
&nbsp; &nbsp; elseif event.type == &quot;applicationExit&quot; then<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; -- this block executed just prior to the app quitting<br />
&nbsp; &nbsp; &nbsp; &nbsp; -- OS closes least recently used app, user explicitly quits, etc.<br />
<br />
&nbsp; &nbsp; elseif event.type == &quot;applicationSuspend&quot; then<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; -- this block executed when app goes into &quot;suspend&quot; state<br />
&nbsp; &nbsp; &nbsp; &nbsp; -- e.g. user receives phone call, presses home button, etc.<br />
<br />
&nbsp; &nbsp; elseif event.type == &quot;applicationResume&quot; then<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; -- this block executed when app resumes from &quot;suspend&quot; state<br />
&nbsp; &nbsp; &nbsp; &nbsp; -- e.g. user goes back into app (while it is still running in bg)<br />
<br />
&nbsp; &nbsp; end<br />
end<br />
Runtime:addEventListener( &quot;system&quot;, onSystemEvent )</div></div>
<p></p>
<p>The above is a barebones system event listener, which you can actually use as a template. Of course, what you put into the individual if/else blocks is completely up to your app.</p>
<p>If you pay close attention, you&#8217;ll notice almost every commercial-grade application or game makes use of one or more of the system events mentioned in this tutorial&mdash;and for good reason: they are not only absolutely necessary for some apps, but they can be leveraged to enhance the user experience tremendously for many apps.</p>
<p>Before releasing your app, take a moment and think to yourself, <em>What should my app do when it goes into suspended mode? When it comes back? Before it closes?</em> And you&#8217;ll likely find a way to make your app even better, or perhaps solve a problem you didn&#8217;t know the solution to prior to learning about system events.</p>
<img src="http://feeds.feedburner.com/~r/AnscaMobileBlog/~4/qjilRgozqXo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.anscamobile.com/2012/05/handling-corona-system-events/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		<feedburner:origLink>http://blog.anscamobile.com/2012/05/handling-corona-system-events/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=handling-corona-system-events</feedburner:origLink></item>
		<item>
		<title>App of the Week: Sparky the Shark</title>
		<link>http://feedproxy.google.com/~r/AnscaMobileBlog/~3/8GFPVw1j3Z4/</link>
		<comments>http://blog.anscamobile.com/2012/05/app-of-the-week-sparky-the-shark/#comments</comments>
		<pubDate>Mon, 14 May 2012 17:08:09 +0000</pubDate>
		<dc:creator>Inna</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://blog.anscamobile.com/?p=15946</guid>
		<description><![CDATA[...]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.anscamobile.com/2012/05/app-of-the-week-sparky-the-shark/sparky-the-shark-logo/" rel="attachment wp-att-15948"><img class="size-full wp-image-15948 alignleft" title="sparky the shark logo" src="http://blog.anscamobile.com/wp-content/uploads/2012/05/sparky-the-shark-logo.jpg" alt="" width="124" height="124" /></a>A quirky and beautiful tale on self acceptance, <a href="http://www.sparkytheshark.com/">Sparky the Shark</a> by Biscuit Interactive, tells the story of a friendly shark named Sparky and his sidekick penguin Dax. Though sharks have quite a bad rep among beach-goers, Sparky desperately wants to make a friend. When Dax breaks the news of the “No Sharks Allowed” beach policy, Sparky is devastated. On Dax’s advice, Sparky goes to all ends to change himself in an attempt to be accepted &#8211; he sports a friendlier set of teeth, gets a less intimidating dorsal fin, and purchases a new set of clothes. Dressed as a clown, Sparky heads to the beach to compete in a sandcastle competition, and the story takes an unexpected turn. You’ll have to read for yourself to find out how Sparky makes friends, and saves the day.</p>
<p>Sparky the Shark features beautiful illustrations, unique musical backgrounds and incredible interactive elements that keep the reader&#8217;s attention throughout all 33 pages. It was also fun to discover the hidden animations scattered throughout the book. For those of you who remember Mr. Potato Head, you&#8217;ll also love the bonus &#8217;Dress Up Sparky Page&#8217; &#8211; where you can dress Sparky in silly disguises, goofy teeth, hats and boggle eyes. You’ll quickly fall in love with the unlikely shark and penguin pair, and through their adventure, learn about the importance of always being yourself.</p>
<p>Fun for readers of all ages, Sparky the Shark is a beautifully crafted story of self-acceptance, kindness and friendship. The digital tale is available for download at the <a href="http://itunes.apple.com/mu/app/sparky-shark-frighteningly/id478654371?mt=8">App Store</a> and for <a href="https://play.google.com/store/apps/details?id=com.sparky.bookapp.sparkytheshark&amp;hl=en">Android.</a></p>
<p><iframe src="http://www.youtube.com/embed/rRPGt7iWwRY" frameborder="0" width="560" height="315"></iframe></p>
<img src="http://feeds.feedburner.com/~r/AnscaMobileBlog/~4/8GFPVw1j3Z4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.anscamobile.com/2012/05/app-of-the-week-sparky-the-shark/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.anscamobile.com/2012/05/app-of-the-week-sparky-the-shark/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=app-of-the-week-sparky-the-shark</feedburner:origLink></item>
		<item>
		<title>Per-file iCloud Backups and Other Changes</title>
		<link>http://feedproxy.google.com/~r/AnscaMobileBlog/~3/wxljorrfki4/</link>
		<comments>http://blog.anscamobile.com/2012/05/per-file-icloud-backups-and-other-changes/#comments</comments>
		<pubDate>Fri, 11 May 2012 15:00:09 +0000</pubDate>
		<dc:creator>Jonathan Beebe</dc:creator>
				<category><![CDATA[Daily Build]]></category>

		<guid isPermaLink="false">http://blog.anscamobile.com/?p=15915</guid>
		<description><![CDATA[...]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.anscamobile.com/wp-content/uploads/2012/05/icloudbackup.png" alt="iCloud backup" style="float:right;padding-left:20px;padding-bottom:20px;width:200px;height:200px"/>As usual, more great stuff has been pushed into the Daily Builds since the update from just last week.</p>
<p>Some notable additions include a few useful new features such as per-file iCloud backups, audio event changes, Storyboard &#8220;debug&#8221; mode and auto-purging capabilities, as well as many notable bug fixes in regards to native video objects, in-Simulator require() calls, display.newEmbossedText() inconsistencies, and more.</p>
<p>To see everything that&#8217;s been pushed into the daily builds, visit the <a href="http://developer.anscamobile.com/corona-daily-builds/summary">Daily Build Summary</a> page to get a complete rundown. Remember, access to cutting edge features and the latest bug fixes through our Daily Builds program is a subscriber-only benefit&mdash;so <a href="http://www.anscamobile.com/pricing/?ref=nav_corona">become a subscriber</a> if you want to get the latest build.</p>
<p><span id="more-15915"></span></p>
<h3>Per-file iCloud Backups</h3>
<p>For iOS 5 users of your app, iCloud will automatically backup the contents of your app&#8217;s Documents folder (system.DocumentsDirectory) for those who have automatic iCloud backups turned on. As of <a href="http://developer.anscamobile.com/release/2012/812">build 2012.812</a>, you can now control which files are <em>not</em> backed up, and even check existing files to see if they are set to be backed up or not. This is accomplished with two new functions: <strong>native.setSync()</strong> and <strong>native.getSync()</strong>.</p>
<p>Turning iCloud backups on/off for a specific file (the default value is on/true):</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local value, err = native.setSync( &quot;datafile3.txt&quot;, { iCloudBackup=true } ) -- on (default)<br />
local value, err = native.setSync( &quot;datafile3.txt&quot;, { iCloudBackup=false } ) -- off</div></div>
<p></p>
<p>In the example above, <em>value</em> will be true/false on success/failure. If a failure occurs for whatever reason, <em>err</em> would contain the error message.</p>
<p>Now, here&#8217;s how to check if a file is set to be backed up or not:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local value, err = native.getSync( &quot;datafile3.txt&quot;, { key=&quot;iCloudBackup&quot; } )</div></div>
<p></p>
<p>In the above case, <em>value</em> would return true/false depending on the &#8220;iCloudBackup&#8221; setting for that file. If an error occurs, <em>err</em> would contain the error message.</p>
<p><strong>NOTE:</strong> These APIs are iOS-only because iCloud is an iOS-only feature. Both functions will simply return <em>nil</em> if called on other platforms.</p>
<h3>Storyboard additions</h3>
<p>Other additions to <a href="http://developer.anscamobile.com/release/2012/812">build 2012.812</a> include two new storyboard flags (storyboard.isDebug and storyboard.purgeOnSceneChange), as well as a new debugging function: storyboard.printMemUsage()</p>
<h4>storyboard.isDebug</h4>
<p>If set to true, useful Storyboard-related information will be outputted to the Terminal in certain situations&mdash;which should aid in the debugging process. For example, if you were to attempt to purge a scene that does not have a &#8220;view&#8221;, you would get the following message in the Terminal:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">STORYBOARD &gt; scene3 was not purged because it's view (display group) does not exist. This means it has already been purged or the view was never created.</div></div>
<p></p>
<p>Or, another example is when you call storyboard.purgeAll(). You&#8217;ll see a message like this:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">STORYBOARD &gt; A total of [3] scene(s) have been purged.</div></div>
<p></p>
<p>Enabling/disabling these debug messages is as simple as setting <strong>storyboard.isDebug</strong> to true or false. The default value is false.</p>
<p>See the <a href="http://developer.anscamobile.com/reference/index/storyboardisdebug">storyboard.isDebug documentation</a> for more information.</p>
<h4>storyboard.purgeOnSceneChange</h4>
<p>By default, Storyboard does not purge scenes (e.g. remove the display group associated with the scene&mdash;known as the scene&#8217;s view) whenever you call storyboard.gotoScene(). Instead, the view is hidden and remains loaded in-case you need to quickly go back to that scene at some point in the near future. When the OS receives a low-memory warning, the least recently used scene will be purged automatically to ensure your app does not crash as a result of</p>
<p>For most users, this is adequate because you simply don&#8217;t have to worry about loading/unloading scenes and it allows your app to perform as quickly as possible by keeping things in memory that were recently used, and auto-purging scenes that were not used recently.</p>
<p>However, you may fall into two <em>other</em> situations:</p>
<ol>
<li>Your scene&#8217;s are somewhat &#8220;heavy&#8221; and you do not want to have to manually call storyboard.purgeScene() or storyboard.purgeAll() on every scene change.</li>
<li>You are developing an Android app. Because most Android devices have unreliable low-memory conditions reporting, <em>not</em> manually purging unused scenes could result in app crashes in situations where Android fails to report low memory conditions properly.</li>
</ol>
<p>For developers that fall into any of the two categories above (or both!), we have added <strong>storyboard.purgeOnSceneChange</strong> which will automatically purge all scenes except for the newly active scene on every call to storyboard.gotoScene() &mdash; in other words, on every scene change.</p>
<p>When this setting is enabled, Storyboard behaves a little more similarly to other popular scene management libraries such as Director class. The default value of storyboard.purgeOnSceneChange is false, so you&#8217;ll have to explicitly &#8220;opt in&#8221; to enable it.</p>
<p>Here&#8217;s a quick example:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">-- main.lua<br />
<br />
local storyboard = require &quot;storyboard&quot;<br />
storyboard.purgeOnSceneChange = true</div></div>
<p></p>
<p>See the <a href="http://developer.anscamobile.com/reference/index/storyboardpurgeonscenechange">storyboard.purgeOnSceneChange documentation</a> for more information.</p>
<h4>storyboard.printMemUsage()</h4>
<p>While we&#8217;re talking about debugging and memory consumption, another useful function added to the Storyboard API is <strong>storyboard.printMemUsage()</strong>, which will print Lua memory and texture memory usage information to the Terminal (similar to how the Storyboard sample app does)&mdash;but only if storyboard.isDebug is set to true (Storyboard debug mode).</p>
<p>To get a more up-to-date account of Lua/Texture memory usage printed to the Terminal, you can use this function in conjunction with an enterFrame listener in main.lua:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local storyboard = require &quot;storyboard&quot;<br />
storyboard.isDebug = true<br />
<br />
Runtime:addEventListener( &quot;enterFrame&quot;, storyboard.printMemUsage )</div></div>
<p></p>
<p>You could also call the function outside of an enterFrame listener to get the Lua/Texture memory usage information for that specific point in time. As a reminder, this function does nothing if storyboard.isDebug is set to false.</p>
<p>See the <a href="http://developer.anscamobile.com/reference/index/storyboardprintmemusage">storyboard.printMemUsage() documentation</a> for more information.</p>
<h3>Bug Fixes</h3>
<p>In addition to the new features mentioned above, there have been several bug fixes and other changes pushed in as well, to include (but is not limited to):</p>
<ul>
<li>event.phase (with &#8220;stopped&#8221; value) added to Audio events.</li>
<li>display.newEmbossedText() bug fixes.</li>
<li>Storyboard bug fixes.</li>
<li>Video objects now suspend/resume automatically with the application.</li>
<li>require() statements in Simulator now consistent with on-device behavior.</li>
<li>event.expiration added to Facebook login events.</li>
<li>system.scheduleNotification() bug fixes</li>
</ul>
<p>The above is not a conclusive list, but covers most of the changes since the previous daily build update. Once again, for a complete listing of all daily build changes, visit the <a href="http://developer.anscamobile.com/corona-daily-builds/summary">Daily Build Summary</a> page.</p>
<p>Who would have known this much stuff could be added/fixed in just a weeks time! If you want to get the build that includes all of the changes that were mentioned here (and more), as well as access to future daily builds with more new features and bug fixes, <a href="http://www.anscamobile.com/pricing/?ref=nav_corona">subscribe now</a> so you can <a href="http://developer.anscamobile.com/downloads/daily-builds">get the latest build</a> today.</p>
<img src="http://feeds.feedburner.com/~r/AnscaMobileBlog/~4/wxljorrfki4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.anscamobile.com/2012/05/per-file-icloud-backups-and-other-changes/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://blog.anscamobile.com/2012/05/per-file-icloud-backups-and-other-changes/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=per-file-icloud-backups-and-other-changes</feedburner:origLink></item>
		<item>
		<title>Developing Apps for a Pre-K Audience</title>
		<link>http://feedproxy.google.com/~r/AnscaMobileBlog/~3/Zl93O1UI_AA/</link>
		<comments>http://blog.anscamobile.com/2012/05/developing-apps-for-a-pre-k-audience/#comments</comments>
		<pubDate>Thu, 10 May 2012 19:02:03 +0000</pubDate>
		<dc:creator>Inna</dc:creator>
				<category><![CDATA[Guest Post]]></category>

		<guid isPermaLink="false">http://blog.anscamobile.com/?p=15902</guid>
		<description><![CDATA[...]]></description>
			<content:encoded><![CDATA[<p><span style="color: #888888;"><em>Inspired by his pre-k sons&#8217; love of construction vehicles, Scott Adelman created the <a href="http://orionsmason.wordpress.com/">Kids Trucks</a> educational app series. The interactive series includes colorful graphics and positive reinforcement, allowing young children to work on learning the alphabet, developing critical thinking skills, number identification and more in an engaging way. Check out Scott&#8217;s post below, for a range of helpful tips on creating mobile apps for tots. Stay tuned for Scott&#8217;s upcoming post on marketing apps for children!</em></span></p>
<p><span style="color: #888888;"><em><span id="more-15902"></span></em></span></p>
<p><img class="alignleft size-full wp-image-15904" title="Kid's Puzzle" src="http://blog.anscamobile.com/wp-content/uploads/2012/05/unnamed.png" alt="" width="124" height="124" />My name is Scott Adelman and I am the creator of the Kids Trucks educational app series. During the day I am a School Psychologist and Counselor at two elementary schools. In the evening and on the weekends, I am a father of twin three year old boys. At night, I develop educational kids apps using Corona SDK.</p>
<p>Working in education and being a father has given me a lot of insight into what will work for young kids. I am well aware of what all kindergartners need to know to be ready to enter elementary school. If you are looking to design pre-k apps, a great start is to take a look at a kindergarten-readiness checklist. Also, check out great apps for kids on the market, that are doing well.  They can give you insight into what parents want their kids to learn.</p>
<p>Positive reinforcement is incredibly important in an educational app for kids. Parents want their children to feel successful and encouraged. In most of my apps, I provide verbal feedback or applause when the child does something correctly. I have also started using <a href="http://www.x-pressive.com/ParticleCandy_Corona/features.html">Particle Candy</a> effects to create things kids love (fireworks, paint splatter, sparkles to name a few). Another idea I was able to easily  implement in Corona was to allow parents to record their own positive encouragement statements.  Lastly, watch out for anything overly negative when a child does something wrong. I once tried out an app for kids that just buzzed at me when I answered incorrectly. This is not encouraging for children. I suggest keeping everything positive &#8211; if the child is wrong you can say &#8220;try again.&#8221;  If they continue to get something wrong, you need to teach them what the right answer is and how to get to it.</p>
<p><img class="alignright  wp-image-15905" title="kid's truck 2" src="http://blog.anscamobile.com/wp-content/uploads/2012/05/kids-truck-2.png" alt="" width="324" height="216" /></p>
<p>A simple user interface is essential as well.  Kids need to be able to navigate through menus without problem. Parents expect this too. If a child has to nag mom/dad in order to get to a particular part of an app, the parents will become annoyed.  For young children that can&#8217;t read yet, a picture menu is  ideal.</p>
<p>Kids make excellent testers for any of the apps that you create. I always play through my apps several times and get some friends to test them out as well before even thinking about submitting them.  Oftentimes, the adult testers will find nothing wrong with the app. When I hand over the iPad to my twin boys, they are more often then not, able to crash my apps.  Things children do that most adults don&#8217;t think of include: two kids touching the app at once, tapping quickly on multiple buttons, dragging fingers on and off the buttons, and touching the screen with entire hands. Given that young kids will often touch the screen with multiple hands or a whole hand, implementing multitouch through Corona makes sense, especially if your target is 1-2 year olds. Button placement is also important. If a button is in a place where it can be easily bumped by part of a hand or a finger, it will happen.</p>
<p>Bright colors and fun animations are vital for young kids. Graphics is an area that young children are less harsh on than their adult counterparts. For young kids, the visuals need to appeal to their  imagination and the artwork needs to be fun. My motto is when in doubt, put an eye on it. You could put an eye on a rock, make it dance around to a silly song, and most pre-k students would enjoy it.  The issue is that you are selling your apps to parents and most will not be searching for a dancing rock app. So be sure to create something that parents will be looking for. I also would recommend that you create art and coding, while keeping in mind that it could be used for future apps as well.</p>
<p>Creating educational kids apps is a fun and rewarding choice. Hopefully some of these tips can help you with your creations. As always, feel free to contact me with any questions, as I am happy share my experiences with others.</p>
<p>Scott Adelman</p>
<p>scottadelman@gmail.com</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/AnscaMobileBlog/~4/Zl93O1UI_AA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.anscamobile.com/2012/05/developing-apps-for-a-pre-k-audience/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://blog.anscamobile.com/2012/05/developing-apps-for-a-pre-k-audience/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=developing-apps-for-a-pre-k-audience</feedburner:origLink></item>
		<item>
		<title>FAQ Wednesday #4</title>
		<link>http://feedproxy.google.com/~r/AnscaMobileBlog/~3/6CtcaXD1Q1w/</link>
		<comments>http://blog.anscamobile.com/2012/05/faq-wednesday-4/#comments</comments>
		<pubDate>Wed, 09 May 2012 17:55:11 +0000</pubDate>
		<dc:creator>Tom Newman</dc:creator>
				<category><![CDATA[Corona SDK]]></category>
		<category><![CDATA[Corona Training]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[CoronaSDK]]></category>
		<category><![CDATA[lua]]></category>

		<guid isPermaLink="false">http://blog.anscamobile.com/?p=15851</guid>
		<description><![CDATA[...]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.anscamobile.com/2012/05/faq-wednesday-3/faq_graphics/" rel="attachment wp-att-15656"><img src="http://blog.anscamobile.com/wp-content/uploads/2012/05/FAQ_Graphics.png" alt="FAQ Graphics" title="FAQ_Graphics" width="228" height="228" class="alignright size-full wp-image-15656" /></a><br />
It&#8217;s Wednesday and time for another FAQ session. Here are five frequently asked questions (FAQ).</p>
<h2 id="question1">Question 1</h2>
<p>When I create functions, I sometimes get error messages saying the function name was <strong>nil</strong>. I play with the code until the error goes away. What are the rules for getting it right?</p>
<p><span id="more-15851"></span></p>
<h2 id="answer">Answer</h2>
<p>Generally Lua requires &#8220;forward references&#8221; on variables if the variables are local. This means that the variable needs to be defined before it can be used. Look at the following example.</p>
<p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local function getTax( num )<br />
&nbsp; &nbsp; return num * 0.0825<br />
end<br />
<br />
print( getTax( 99.95 ) )</div></div>
</p>
<p>The above works because <strong>getTax</strong> was defined first. </p>
<p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">print( getTax( 99.95 ) )<br />
<br />
local function getTax( num )<br />
&nbsp; &nbsp; return num * 0.0825<br />
end</div></div>
</p>
<p>The above doesn&#8217;t work because <strong>getTax</strong> is unknown and returns with a &#8220;nil&#8221; error. If you always define your variables or functions first (before being called), you won&#8217;t have any problems, but sometimes you can&#8217;t avoid it. Here is how you can fix </p>
<p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local getTax -- forward reference<br />
<br />
local function printTax()<br />
&nbsp; &nbsp; print( getTax( 99.95 ) )<br />
end<br />
<br />
function getTax( num )<br />
&nbsp; &nbsp; return num * 0.0825<br />
end<br />
<br />
printTax()</div></div>
</p>
<p>This code works because the placeholder for <strong>getTax</strong> was defined first and then set to the value of the function. The call to <strong>getTax</strong> is enclosed in a function so it&#8217;s called after the function is defined and assigned to the variable.</p>
<p>One common mistake is the following:</p>
<p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local getTax -- forward reference<br />
<br />
local function printTax()<br />
&nbsp; &nbsp; print( getTax( 99.95 ) )<br />
end<br />
<br />
local function getTax( num )<br />
&nbsp; &nbsp; return num * 0.0825<br />
end<br />
<br />
printTax()</div></div>
</p>
<p>This will fail with a &#8220;nil&#8221; error. The reason is the &#8220;local&#8221; in front of the <strong>getTax</strong> function. We already defined <strong>getTax</strong> as a local variable and when you add &#8220;local&#8221; in front of &#8220;function getTax&#8221;, we are effectively defining a new variable, leaving the original <strong>getTax</strong> variable nil. You can prove this for yourself by adding print statements in your code to display the value of variables at different points to see how they are affected placement in your code.</p>
<p>You can avoid the scoping issue by making all your variables <strong>global</strong>. You do this by not including <strong>local</strong> before the variable name. This is fine for a few variables but not recommend if you have a lot of variables or if performance is an issue. It&#8217;s also not recommended if you are loading modules with lots of variables.</p>
<p>There is a lot more to variable scoping than what I listed here, so I recommend checking out <a href="http://www.lua.org/manual/5.1/">Lua 5.1 Reference Manual</a>.</p>
<h2 id="question2">Question 2</h2>
<p>How can I get the HTTP status code when I access a website with native.webPopup? </p>
<h2 id="answer">Answer</h2>
<p>The <strong>HTTP Status Code</strong> is returned by web servers and used to indicate if a HTTP request was successful or not. Here are some typical status codes:</p>
<ul>
<li>200 OK</li>
<li>301 Moved Permanenly</li>
<li>404 Not Found</li>
<li>500 Internal Server Error</li>
</ul>
<p>You can find more information <a href="http://datatracker.ietf.org/doc/rfc2616/?include_text=1">here.</a></p>
<p>In Corona, <strong>native.wevPopup</strong> and <strong>native.webView</strong> don&#8217;t provide this HTTP Status Code, but <strong>network.request</strong> does (in the current Daily Builds). The <strong>event.isError</strong> field from either webPopup or webView is only set when it fails to connect to the server. If you access a page and get a <strong>404 error</strong> (page not found), <strong>isError</strong> will not be set. You should call <strong>network.request</strong> the first time you access a web page to verify that it&#8217;s available or call it when you are not getting the proper results when you access a page.</p>
<p>Here is how you could use this in your code.</p>
<p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local function loadWebPage()<br />
&nbsp; &nbsp; native.showWebPopup(10, 10, 300, 300, url )<br />
end<br />
<br />
local function networkListener( event )<br />
&nbsp; &nbsp; if( event.isError ) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; print( &quot;Network error: &quot;, event.response )<br />
&nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; print( &quot;Status Code: &quot; .. event.status )<br />
&nbsp; &nbsp; &nbsp; &nbsp; if event.status == 200 then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print( &quot;Loading web page ...&quot; )<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loadWebPage()<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print( &quot;Web page not loaded!&quot; )<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; end<br />
end<br />
<br />
network.request( url, &quot;GET&quot;, networkListener )</div></div>
</p>
<p>The code calls <strong>network.request</strong> first to access the web page. If the status code is <strong>200</strong> (meaning OK), <strong>loadWebPage</strong> is called and the page is loaded using <strong>native.webPopup</strong>.</p>
<p>Note: <strong>native.webView</strong> has been implemented on iOS devices to replace <strong>native.webPopup</strong> and is the recommended API for displaying web pages. We hope to have this API available soon on Android, Mac, and Windows.</p>
<h2 id="question3">Question 3</h2>
<p>Does Ansca see my source code when I do a build? How secure is my project when it&#8217;s sent to your server?</p>
<h2 id="answer">Answer</h2>
<p>During the online build process, our servers never see your raw source code — or for that matter any of your project images, sounds, or other assets. The Lua script is precompiled into bytecodes (stripping out comments, debug information, etc) before it gets sent to our server. The server embeds this data into the Corona engine, but never saves or archives it. By the end of the online build process, you will have an <strong>.app</strong> bundle or <strong>.apk</strong> file just as you would get if you had used the iOS or Android SDK yourself.</p>
<h2 id="question4">Question 4</h2>
<p>I posted a bug on the API page (comments section) but it doesn&#8217;t get fixed. Why?</p>
<h2 id="answer">Answer</h2>
<p>The &#8220;comments&#8221; section on the API pages is not the place to post bugs or ask questions. The intent of this section is to report errors or missing information in the API documentation.</p>
<p>If you think you found a bug with the API, please file a bug report. The link is at the top of Forum and Documentation pages. In the bug report please include as much information as you can about the bug, including the build number, the device, the OS and if this is a new bug, which build number introduced the bug. </p>
<p>It&#8217;s also important to include a complete (yet small) project file demonstrating the problem. Just supplying a few lines of code and saying this shows the problem means the bug report will most likely be place at the bottom of our &#8220;to do&#8221; list. We receive lots of bug reports and it takes time for us to create sample test cases to verify the problem. Sometimes, we don&#8217;t see the problem because of a missing config.lua or build.settings file. If the bug is important to you, please help us by sending in a working sample and describe how we can reproduce the problem.</p>
<p>We are working on a new documentation system and it should be available online soon. This new system will not have a &#8220;comments&#8221; section so you will need to post your API-related questions on the forums or file bug reports.</p>
<h2 id="question5">Question 5</h2>
<p>I added print statements to debug my code, but I get a lot of &#8220;nil&#8221; errors. Is there a secret to avoiding that?</p>
<h2 id="answer">Answer</h2>
<p>Most likely you have something like this in your code:</p>
<p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">print( &quot;lineNumber = &quot; .. lineNumber )</div></div>
</p>
<p>If <strong>lineNumber</strong> is nil because of a scoping problem or it has never been set, the print statement will fail saying, &#8220;attempt to concatenate &#8216;lineNumber&#8217; (a nil value)&#8221;.</p>
<p>You can avoid the problem by using &#8220;,&#8221; to separate your variables.</p>
<p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">print( &quot;lineNumber = &quot; , lineNumber )</div></div>
</p>
<p>This avoids the concatenation error, but it will add extra spaces before printing the value of <strong>lineNumber</strong> that you may not want </p>
<p>Another way to avoid the &#8220;nil&#8221; problem is to use <strong>&#8220;tostring&#8221;</strong>.</p>
<p><div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">print( &quot;lineNumber = &quot; .. tostring( lineNumber ) )</div></div>
</p>
<p>This converts the value passed to <strong>tostring</strong> into a string &#8211; no matter what it is (even <strong>nil</strong> values). This is great for number, strings, tables, display objects, etc. It allows you to control the print formatting without print errors.</p>
<p>That&#8217;s it for today&#8217;s questions. I hope you enjoyed it and even learned a few things.</p>
<img src="http://feeds.feedburner.com/~r/AnscaMobileBlog/~4/6CtcaXD1Q1w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.anscamobile.com/2012/05/faq-wednesday-4/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://blog.anscamobile.com/2012/05/faq-wednesday-4/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=faq-wednesday-4</feedburner:origLink></item>
		<item>
		<title>Pune, India: First Corona SDK Meetup</title>
		<link>http://feedproxy.google.com/~r/AnscaMobileBlog/~3/LvBG7EeT1ho/</link>
		<comments>http://blog.anscamobile.com/2012/05/pune-india-first-corona-meetup/#comments</comments>
		<pubDate>Tue, 08 May 2012 21:00:02 +0000</pubDate>
		<dc:creator>Inna</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://blog.anscamobile.com/?p=15805</guid>
		<description><![CDATA[...]]></description>
			<content:encoded><![CDATA[<p><em><span style="color: #888888;">We&#8217;re thrilled to announce that the recently launched meetup group in Pune, India, has hosted their first Corona SDK event! <em>Amit Surve, </em>Corona enthusiast and team member at <a href="http://www.redbytes.in/">Redbytes Software</a>, shares his experience on last weekend&#8217;s event. </span></em><em><span style="color: #888888;">The group&#8217;s next meetup will be hosted in partnership with the Computer Society of India (CSI) Pune Chapter on May 11-12. More details on the event can be found <a href="http://ambassador.anscamobile.com/event/mobile-app-game-development-using-corona-sdk-2/">here</a>. Check out the group&#8217;s <a href="https://www.facebook.com/events/211499615620192/">Facebook</a> page for up-to-date information!</span></em></p>
<p><span id="more-15805"></span></p>
<p><a href="http://blog.anscamobile.com/2012/05/pune-india-first-corona-meetup/puneimage/" rel="attachment wp-att-15806"><img class="alignleft  wp-image-15806" title="puneimage" src="http://blog.anscamobile.com/wp-content/uploads/2012/05/puneimage.png" alt="" width="343" height="227" /></a>A well-received session is the happiest moment for a meetup organizer. It was one such moment for the Redbytes Team on Saturday, May 5, 2012. The first ever session of  “Mobile App &amp; Game Development Using Corona-SDK (MAGD)” held in Pune, India was well received and attended by around 36 people. It was a mix of students and professionals. Though the initial registration for the event was around 90 people, only 36 attended due to other technical events happening in the city. One thing we can very confidently say about those who attended, was that they were very happy with the contents of the session. What else can we say about a session that extended two hours past the scheduled end time?</p>
<p>This session was conducted by Mr. Altaf Rehmani, Founder &amp; Technical Director at Redbytes Software Pvt. Ltd. Altaf talked about a range of topics including an introduction to Corona, the benefits of the product, development success stories and a few code snippets of an application using Corona. The session also emphasized the strong Corona developer community worldwide, the meetup forums created by Ansca Mobile for user support, as well as our local community, <a href="http://www.meetup.com/Corona-SDK-Pune-Meetup/.">SDK Pune Meetup</a>. The talk was followed by a Q&amp;A session,  however participants freely asked questions throughout the talk as well. Some of the interesting questions that arose throughout the session centered on the licensing policy of Ansca, request for discounts, IP protection, and training options available on Corona SDK at Redbytes.</p>
<p>After Altaf&#8217;s session, Ali (Head of the Product &amp; Game Development Division at Redbytes) took over. He gave an overview of developing games using Corona and showed a sample game creation to the audience, which convinced many participants about the ease of using Corona.</p>
<p>Overall, our event was a wonderful and educational session which gave a lot of exposure not only to the team at Redbytes but also to the participants. We are looking forward to our next session, scheduled for June.</p>
<p>For those who missed this session or for participants who want to take the next step towards learning about Corona, we have another session planned with the Computer Society of India, CSI-Pune Chapter on May 11-May 12, 2012.</p>
<img src="http://feeds.feedburner.com/~r/AnscaMobileBlog/~4/LvBG7EeT1ho" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.anscamobile.com/2012/05/pune-india-first-corona-meetup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.anscamobile.com/2012/05/pune-india-first-corona-meetup/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=pune-india-first-corona-meetup</feedburner:origLink></item>
		<item>
		<title>LuaFileSystem (LFS) Tutorial</title>
		<link>http://feedproxy.google.com/~r/AnscaMobileBlog/~3/aPjixjgOPjI/</link>
		<comments>http://blog.anscamobile.com/2012/05/luafilesystem-lfs-tutorial/#comments</comments>
		<pubDate>Tue, 08 May 2012 15:00:52 +0000</pubDate>
		<dc:creator>Jonathan Beebe</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.anscamobile.com/?p=15819</guid>
		<description><![CDATA[...]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.anscamobile.com/wp-content/uploads/2012/05/luafilesystem1.png" alt="LuaFileSystem + Corona SDK" style="float:right;padding-left:28px;padding-bottom:20px;padding-right:25px"/>I mentioned in last Friday&#8217;s <a href="http://blog.anscamobile.com/2012/05/luafilesystem-lfs-coming-soon/">daily build update</a> that a <a href="http://keplerproject.github.com/luafilesystem/">LuaFileSystem</a> (LFS) tutorial is coming&mdash;so here it is!</p>
<p>For those who don&#8217;t know what LFS is, it&#8217;s a popular Lua library that allows you to perform common filesystem activities that can&#8217;t normally be done in plain Lua. Things like getting file attributes, creating and removing directories (folders), and iterating over files in a directory are all things that can be easily done using LFS.</p>
<p>Now that the <a href="http://developer.anscamobile.com/downloads/daily-builds">daily build</a> with it has been posted, I&#8217;ll walk you through some of the more common things you might find yourself using LFS for in a real Corona app. During the course of this tutorial, it might help to have a separate tab open with the <a href="http://keplerproject.github.com/luafilesystem/manual.html#reference">LFS Reference</a>.</p>
<p><span id="more-15819"></span></p>
<h3>Directory Scanning</h3>
<p>Let&#8217;s say you were creating a note-taking app that allows users to create, save, and read text-based notes that are all saved to <strong>system.DocumentsDirectory</strong>. Sure, it&#8217;s easy to keep track of what the user does inside of your app. You could simply keep your own record of the notes within a &#8220;notes&#8221; table and update it whenever something is added or removed from the app&#8217;s Documents folder.</p>
<p>But what if you wanted to enable file-sharing through the iTunes interface so users can import and export their notes (<a href="http://developer.anscamobile.com/forum/2012/02/10/using-external-file-app-runtime#comment-86976">go here</a> to find out how to enable iTunes file sharing)?</p>
<p>The problem with that is, since the user is adding (and possibly removing) files to the Documents folder of your app bundle from <em>outside</em> of your app, the table you&#8217;re using to keep track of available notes is going to be inaccurate.</p>
<p>Here&#8217;s where LuaFileSystem would come in really handy. Every time your app is launched, you can use LFS to scan the contents of system.DocumentsDirectory and import any new notes! You could do this as much as you needed to ensure you have an accurate account of exactly what is inside that folder. Of course, that&#8217;s just one example where you might use this functionality. As with everything, it all boils down to the individual needs of your app.</p>
<p>Here&#8217;s an example of how to iterate over the contents of the app&#8217;s Documents directory using a simple for-loop:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local lfs = require &quot;lfs&quot;<br />
<br />
local doc_path = system.pathForFile( &quot;&quot;, system.DocumentsDirectory )<br />
<br />
for file in lfs.dir(doc_path) do<br />
&nbsp; &nbsp; -- file is the current file or directory name<br />
&nbsp; &nbsp; print( &quot;Found file: &quot; .. file )<br />
end</div></div>
<p></p>
<h3>Adding Folders</h3>
<p>One of the things most commonly requested with Corona&#8217;s Documents, Temporary, and Cache folders is the ability to add new directories (e.g. folders) within them for easier organization.</p>
<p>If your app downloads several external assets and you would like to organize different types of files into different folders (or are working with lots of files with similar or same file names), being able to add and remove folders is something that&#8217;s absolutely essential.</p>
<p>Thankfully, LFS makes this easy as well. First, you&#8217;ll need to change the &#8220;current directory&#8221; to where you want to place the folder using <strong>lfs.chdir()</strong>, and then you&#8217;ll use <strong>lfs.mkdir()</strong> to actually create the directory.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local lfs = require &quot;lfs&quot;<br />
<br />
-- get raw path to app's Temporary directory<br />
local temp_path = system.pathForFile( &quot;&quot;, system.TemporaryDirectory )<br />
<br />
-- change current working directory<br />
local success = lfs.chdir( temp_path ) -- returns true on success<br />
local new_folder_path<br />
<br />
if success then<br />
&nbsp; &nbsp; lfs.mkdir( &quot;MyNewFolder&quot; )<br />
&nbsp; &nbsp; new_folder_path = lfs.currentdir() .. &quot;/MyNewFolder&quot;<br />
end</div></div>
<p></p>
<div class="box">
<h4>What about deleting folders?</h4>
<p>If you need to remove (delete) a directory, it is recommended you use the existing <a href="http://developer.anscamobile.com/reference/index/osremove">os.remove()</a> function to do so. While <strong>lfs.rmdir()</strong> can only remove directories, os.remove() can handle both.
</div>
<h3>Timestamps</h3>
<p>Another thing you might need your app to do periodically is check the &#8220;last modified&#8221; timestamp of certain files, especially if you&#8217;re implementing any kind of syncing functionality, or even something as simple as keeping track of when the user last loaded a specific file (but didn&#8217;t necessarily change it).</p>
<h4>Setting a new timestamp</h4>
<p>Let&#8217;s say we have a file called &#8220;mydata.txt&#8221; inside of <strong>system.TemporaryDirectory</strong>. The user wants to view the file, but we want to set the timestamp for when the user last read the file (not just the last time they wrote to it).</p>
<p>In that case, we would simply &#8220;touch&#8221; the file. In doing so, we set the &#8220;last modified&#8221; timestamp to today/now. You can also set a custom &#8220;access time&#8221; and &#8220;modification time&#8221; with two additional function arguments, or leave them blank to use the current time.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local lfs = require &quot;lfs&quot;<br />
<br />
local file_path = system.pathForFile( &quot;mydata.txt&quot;, system.TemporaryDirectory )<br />
<br />
-- touch the file<br />
lfs.touch( file_path )</div></div>
<p></p>
<h4>Retrieving a timestamp for an existing file</h4>
<p>Now, later on, let&#8217;s find out when the file was last modified. You can either use the &#8220;access&#8221; or &#8220;modification&#8221; property, but if you&#8217;re going by the previous example, they would both equal the same thing.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local lfs = require &quot;lfs&quot;<br />
<br />
local file_path = system.pathForFile( &quot;mydata.txt&quot;, system.TemporaryDirectory )<br />
<br />
-- get last modified time<br />
local file_attr = lfs.attributes( file_path )<br />
local last_mod = file_attr.modification<br />
<br />
print( last_mod )</div></div>
<p></p>
<p>LuaFileSystem can do more things than what I showed you here, but chances are, your uses for it in a mobile app will fall into one of the three things I mentioned here. Fortunately, just about all of the LFS functions are straight-forward and easy to use. Please see the <a href="http://keplerproject.github.com/luafilesystem/manual.html#reference">LFS Reference</a> page for a complete listing of available functions and syntax information for each one.</p>
<p>As a reminder, this feature is available to <a href="http://www.anscamobile.com/pricing/?ref=nav_corona">subscribers only</a> at the moment through the <a href="http://developer.anscamobile.com/downloads/daily-builds">daily builds</a>.</p>
<img src="http://feeds.feedburner.com/~r/AnscaMobileBlog/~4/aPjixjgOPjI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.anscamobile.com/2012/05/luafilesystem-lfs-tutorial/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://blog.anscamobile.com/2012/05/luafilesystem-lfs-tutorial/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=luafilesystem-lfs-tutorial</feedburner:origLink></item>
		<item>
		<title>App of the Week/Month – Updated Rules</title>
		<link>http://feedproxy.google.com/~r/AnscaMobileBlog/~3/b9OlS5rV1sY/</link>
		<comments>http://blog.anscamobile.com/2012/05/app-of-the-weekmonth-updated-rules/#comments</comments>
		<pubDate>Mon, 07 May 2012 19:03:03 +0000</pubDate>
		<dc:creator>Inna</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://blog.anscamobile.com/?p=15781</guid>
		<description><![CDATA[...]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.anscamobile.com/2012/05/app-of-the-weekmonth-updated-rules/builtwithcorona_lg/" rel="attachment wp-att-15782"><img class="alignleft size-full wp-image-15782" title="BuiltwithCorona_LG" src="http://blog.anscamobile.com/wp-content/uploads/2012/05/BuiltwithCorona_LG.png" alt="" width="180" height="250" /></a>From banana-craving monkeys shooting out of cannons, to a little boy&#8217;s journey in a submarine, we&#8217;ve seen some pretty amazing work  from Corona developers. We know you all work very hard to create the very best, high quality apps and we&#8217;re honored to recognize your hard work through App of the Week and Month selections.</p>
<p>We began recognizing exceptional Corona-made apps in 2010, and we think it’s time for us to update our guidelines for longtime fans and introduce the process for new friends. We’ve always made an effort to select great apps that deserve recognition, but have at times been flexible with some of the other elements. We realize this has caused consternation (including very recently!) and we apologize about any confusion this caused. With these updated rules in place, we&#8217;re going to be more stringent when selecting future winners.</p>
<p>Each Monday, we’ll continue to feature an exemplary Corona-made app as App of the Week, selected from the Corona <a href="http://developer.anscamobile.com/showcase/">showcase</a>. Apps will be picked based on a number of criteria including (but not limited to): design, sound, interactivity, originality, and usability. At the end of each month, we’ll let the Corona community decide their favorite, among the App of the Week winners that month. This “People’s Choice” will be awarded App of the Month.</p>
<p>We want to give Corona developers every opportunity to shine, and we recognize that there are a plethora of super impressive Corona-made apps that don’t get featured as App of the Week/Month. For this reason, we’ll start to feature additional notable apps throughout each month, reach out to the Corona community for input on their favorites, highlight Corona staff picks and more &#8211; stay tuned!</p>
<p>There are just a few requirements for eligibility:<strong></strong><strong><br />
</strong></p>
<ul>
<li>Your app must have been submitted to the Corona <a href="http://developer.anscamobile.com/showcase/submit-your-game-or-app">showcase</a>.</li>
<li>Your website must include the &#8220;developed with Corona&#8221; <a href="http://developer.anscamobile.com/showcase/display-badge-your-website">badge</a>. (If you don&#8217;t have a website, you can add a &#8220;Developed with Corona&#8221; note in the &#8220;About&#8221; section of your Facebook page.)</li>
<li>We ask that iOS winners please provide the Corona team with a minimum of 5 promo codes (for paid apps). We’d love to show off your winning app to friends, family and the community!</li>
</ul>
<p>Now on to the best part: perks!</p>
<ul>
<li>App of the Month winners will get a 6-month extension on their Corona license; App of the Week winners will enjoy a 3-month extension.</li>
<li>All App of the Month winners will be featured in a video demo on <a href="http://www.crazymikesapps.com/">CrazyMikesApps.com</a>; iOS App of the Week winners will get a <a href="http://www.crazymikesapps.com/category/promo-codes/">mention</a> on CrazyMikesApps, provided that they send over 5 promo codes for reader giveaways.</li>
<li>All winners can take advantage of a 12% discount on marketing campaigns with Appsfire.</li>
<li>We’re continuing to expand our partnerships, to provide benefits both to winners and to the general Corona community &#8211; stay tuned!</li>
</ul>
<p>Please note, the above rules and perks are always subject to change. We will do our very best to keep you posted on major new developments.</p>
<p>To summarize: <strong>if your app is in our showcase and a “built with Corona” badge is displayed on your site, your app is eligible!</strong> All winners will be picked from our showcase, regardless of when an app is added. For example, if you added your app three months ago and we just discovered its fantastic gameplay, graphics, and the like, we may pick it as App of the Week at any point.</p>
<p>We love seeing all the fantastic apps you create, and look forward to sharing your accomplishments with the Corona community and beyond!</p>
<p><strong>Editor’s note</strong>: We are disabling comments for this post, but would love your feedback. Please shoot us an email with any questions/inquiries/feedback! <a href="mailto:Inna@anscamobile.com">Inna@anscamobile.com</a></p>
<img src="http://feeds.feedburner.com/~r/AnscaMobileBlog/~4/b9OlS5rV1sY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.anscamobile.com/2012/05/app-of-the-weekmonth-updated-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.anscamobile.com/2012/05/app-of-the-weekmonth-updated-rules/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=app-of-the-weekmonth-updated-rules</feedburner:origLink></item>
		<item>
		<title>LuaFileSystem (LFS) Coming Soon</title>
		<link>http://feedproxy.google.com/~r/AnscaMobileBlog/~3/5zRXyW3VOt8/</link>
		<comments>http://blog.anscamobile.com/2012/05/luafilesystem-lfs-coming-soon/#comments</comments>
		<pubDate>Fri, 04 May 2012 15:00:47 +0000</pubDate>
		<dc:creator>Jonathan Beebe</dc:creator>
				<category><![CDATA[Daily Build]]></category>

		<guid isPermaLink="false">http://blog.anscamobile.com/?p=15763</guid>
		<description><![CDATA[...]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.anscamobile.com/wp-content/uploads/2012/05/luafilesystem.png" alt="LuaFileSystem in Corona" style="float:right;padding-left:25px;padding-bottom:w25px;padding-right:25px;" />Something that has been consistently requested for a while now was more file-system related control, that is, more than what the current <a href="http://developer.anscamobile.com/content/file-io">File I/O API</a> allows you to do. Such as, allowing developers to get the listing of files in a specific directory, create folders (in Documents and Temporary directories), remove directories, and even get the attributes of a specific file&mdash;all things that have been impossible to do in Corona.</p>
<p>Impossible until now, that is. I&#8217;m happy to announce that coming soon to a daily-build-near-you is the highly-requested <a href="http://keplerproject.github.com/luafilesystem/">LuaFileSystem</a> (LFS) library, which will enable all the things mentioned, as well as a little more.</p>
<p><span id="more-15763"></span></p>
<p>What this also means is that awesome libraries that depend on LuaFileSystem, such as <a href="https://github.com/stevedonovan/Penlight">Penlight</a> is now available for use in Corona projects! Please keep in mind, however, that some functionality of 3rd party Lua libraries may not be present depending on other dependencies, or if they try to do things that are not permitted on your target device.</p>
<p>LuaFileSystem will be available starting in the next daily build (we&#8217;re working on getting it posted). Once it&#8217;s ready, using it is simply a matter of adding:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">local lfs = require &quot;lfs&quot;</div></div>
<p>&#8230;In the Lua source file you plan on using it. From there, take a look at the <a href="http://keplerproject.github.com/luafilesystem/manual.html#reference">LFS Reference</a> for a listing of all the functions and syntax (a tutorial will be coming soon!).</p>
<p>While you&#8217;re waiting for the build to post, <a href="http://www.anscamobile.com/pricing/?ref=nav_corona">subscribe now</a> so you can get it as soon as it&#8217;s available. As a reminder, access to daily builds is a benefit extended to Corona subscribers only.</p>
<h4>Bug Fixes</h4>
<p>Speaking of daily builds, we pushed in a number of bug fixes over the past few weeks. Listed below is just a few of the major ones, but you can see a <a href="http://developer.anscamobile.com/corona-daily-builds/summary">complete listing here</a>.</p>
<ul>
<li>Fixed &#8220;bad builds&#8221; issue due to problems with build.settings (you&#8217;ll now get an error).</li>
<li>Windows: stderr is now logged to the Corona Simulator output console.</li>
<li>Several Kindle Fire and Nook-specific bug fixes.</li>
<li>Several Storyboard and Widget bug fixes.</li>
<li>Added workarounds for OpenAL suspend/resume bugs having to do with multiple OpenAL apps running at once.</li>
<li>Fixed crashes that occurred when touching masked objects.</li>
<li>Fixed post-collision mis-reporting bugs.</li>
<li>Several internal OpenGL-related issues.</li>
<li>display.newText() bug fixes.</li>
<li>And more!</li>
</ul>
<p>Once again, the above list is just a short sample&mdash;there&#8217;s too many to list! To see a complete listing of all the bug fixes, additions, and other changes, see the <a href="http://developer.anscamobile.com/corona-daily-builds/summary">daily build summary</a> page.</p>
<p>And if you haven&#8217;t already, <a href="http://www.anscamobile.com/pricing/?ref=nav_corona">subscribe now</a> to get the latest build today.</p>
<img src="http://feeds.feedburner.com/~r/AnscaMobileBlog/~4/5zRXyW3VOt8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.anscamobile.com/2012/05/luafilesystem-lfs-coming-soon/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://blog.anscamobile.com/2012/05/luafilesystem-lfs-coming-soon/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=luafilesystem-lfs-coming-soon</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 1.042 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-15 22:00:20 -->

