{"id":355,"date":"2012-10-15T12:44:27","date_gmt":"2012-10-15T12:44:27","guid":{"rendered":"http:\/\/rosarioconsulting.net\/inspiredtoeducate\/?p=355"},"modified":"2012-10-15T12:52:03","modified_gmt":"2012-10-15T12:52:03","slug":"learn-how-to-create-a-mobile-app-in-minutes","status":"publish","type":"post","link":"https:\/\/inspiredtoeducate.net\/inspiredtoeducate\/learn-how-to-create-a-mobile-app-in-minutes\/","title":{"rendered":"Learn how to create a mobile app in minutes using Corona SDK"},"content":{"rendered":"\n<!-- Facebook Like Button v1.9.6 BEGIN [http:\/\/blog.bottomlessinc.com] -->\n<iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Finspiredtoeducate.net%2Finspiredtoeducate%2Flearn-how-to-create-a-mobile-app-in-minutes%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light\" scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" style=\"border:none; overflow:hidden; width:450px; height: 30px; align: left; margin: 2px 0px 2px 0px\"><\/iframe>\n<!-- Facebook Like Button END -->\n<p>Many of my readers may enjoy learning how they can create apps for their favorite mobile devices: ipad, iphone, or Android. \u00a0 \u00a0The <a title=\"Corona Labs\" href=\"http:\/\/www.coronalabs.com\/\" target=\"_blank\">Corona SDK<\/a> provides an elegant framework for quickly creating applications and games. \u00a0 \u00a0I have heard stories of middle school students creating rocking games with this tool. \u00a0 \u00a0So, I just had to check it out. \u00a0 In this five minute tutorial, I will walk through the process of creating a simple clock.<\/p>\n<p><a href=\"http:\/\/rosarioconsulting.net\/inspiredtoeducate\/wp-content\/uploads\/2012\/10\/clock.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-356\" title=\"clock\" src=\"http:\/\/rosarioconsulting.net\/inspiredtoeducate\/wp-content\/uploads\/2012\/10\/clock.jpg\" alt=\"Clock\" width=\"323\" height=\"647\" \/><\/a><\/p>\n<p><!-- copy and paste. Modify height and width if desired. --><br \/>\n<object id=\"scPlayer\" width=\"600\" height=\"688\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0\"><param name=\"quality\" value=\"high\" \/><param name=\"flashVars\" value=\"thumb=http:\/\/content.screencast.com\/users\/mrosario\/folders\/Jing\/media\/c77d478d-7f99-470d-940a-d8e6c65a052e\/FirstFrame.jpg&amp;containerwidth=600&amp;containerheight=688&amp;content=http:\/\/content.screencast.com\/users\/mrosario\/folders\/Jing\/media\/c77d478d-7f99-470d-940a-d8e6c65a052e\/00000019.swf&amp;blurover=false\" \/><param name=\"allowFullScreen\" value=\"true\" \/><param name=\"scale\" value=\"showall\" \/><param name=\"allowScriptAccess\" value=\"always\" \/><param name=\"base\" value=\"http:\/\/content.screencast.com\/users\/mrosario\/folders\/Jing\/media\/c77d478d-7f99-470d-940a-d8e6c65a052e\/\" \/><param name=\"src\" value=\"http:\/\/content.screencast.com\/users\/mrosario\/folders\/Jing\/media\/c77d478d-7f99-470d-940a-d8e6c65a052e\/jingswfplayer.swf\" \/><param name=\"flashvars\" value=\"thumb=http:\/\/content.screencast.com\/users\/mrosario\/folders\/Jing\/media\/c77d478d-7f99-470d-940a-d8e6c65a052e\/FirstFrame.jpg&amp;containerwidth=600&amp;containerheight=688&amp;content=http:\/\/content.screencast.com\/users\/mrosario\/folders\/Jing\/media\/c77d478d-7f99-470d-940a-d8e6c65a052e\/00000019.swf&amp;blurover=false\" \/><param name=\"allowfullscreen\" value=\"true\" \/><param name=\"allowscriptaccess\" value=\"always\" \/><embed id=\"scPlayer\" width=\"600\" height=\"688\" type=\"application\/x-shockwave-flash\" src=\"http:\/\/content.screencast.com\/users\/mrosario\/folders\/Jing\/media\/c77d478d-7f99-470d-940a-d8e6c65a052e\/jingswfplayer.swf\" quality=\"high\" flashVars=\"thumb=http:\/\/content.screencast.com\/users\/mrosario\/folders\/Jing\/media\/c77d478d-7f99-470d-940a-d8e6c65a052e\/FirstFrame.jpg&amp;containerwidth=600&amp;containerheight=688&amp;content=http:\/\/content.screencast.com\/users\/mrosario\/folders\/Jing\/media\/c77d478d-7f99-470d-940a-d8e6c65a052e\/00000019.swf&amp;blurover=false\" allowFullScreen=\"true\" scale=\"showall\" allowScriptAccess=\"always\" base=\"http:\/\/content.screencast.com\/users\/mrosario\/folders\/Jing\/media\/c77d478d-7f99-470d-940a-d8e6c65a052e\/\" flashvars=\"thumb=http:\/\/content.screencast.com\/users\/mrosario\/folders\/Jing\/media\/c77d478d-7f99-470d-940a-d8e6c65a052e\/FirstFrame.jpg&amp;containerwidth=600&amp;containerheight=688&amp;content=http:\/\/content.screencast.com\/users\/mrosario\/folders\/Jing\/media\/c77d478d-7f99-470d-940a-d8e6c65a052e\/00000019.swf&amp;blurover=false\" allowfullscreen=\"true\" allowscriptaccess=\"always\" \/><\/object><\/p>\n<p>The Corona and Lua community have created an extensive collection of learning resources:<\/p>\n<ul>\n<li>Lua Tutorials:\u00a0<a href=\"http:\/\/lua-users.org\/wiki\/TutorialDirectory\">http:\/\/lua-users.org\/wiki\/TutorialDirectory<\/a><\/li>\n<li>Corona Tutorials:\u00a0<a href=\"http:\/\/www.learningcorona.com\/\">http:\/\/www.learningcorona.com\/<\/a><\/li>\n<li>Corona Labs:\u00a0<a href=\"http:\/\/www.coronalabs.com\/\">http:\/\/www.coronalabs.com\/<\/a><\/li>\n<li>Stories of indie game developers using Corona:\u00a0<a href=\"http:\/\/www.indiegamepod.com\/\">http:\/\/www.indiegamepod.com\/<\/a><\/li>\n<li>Clock tutorial that inspired this one:\u00a0<a href=\"http:\/\/mobile.tutsplus.com\/tutorials\/corona\/corona-sdk-creating-an-analog-clock-app\/\">http:\/\/mobile.tutsplus.com\/tutorials\/corona\/corona-sdk-creating-an-analog-clock-app\/<\/a><\/li>\n<\/ul>\n<p>Please let me know if you find this tutorial helpful.<\/p>\n<p>What do you want to build today?<\/p>\n<blockquote><p>local function drawClock(e)<br \/>\nnow = os.date(&#8220;*t&#8221;) &#8212; defaults to current date and time<\/p>\n<p>display_width = display.contentWidth<br \/>\ndisplay_height = display.contentHeight<\/p>\n<p>local background = display.newRect(0, 0, display_width, display_height)<br \/>\nbackground.strokeWidth = 3<br \/>\nbackground:setFillColor(20, 20, 20)<br \/>\nbackground:setStrokeColor(180, 180, 180)<\/p>\n<p>&#8212; draw circle<br \/>\ncenter_x = display_width \/ 2<br \/>\ncenter_y = display_height \/ 2<br \/>\nclock_radius = display_width \/2<\/p>\n<p>local myCircle = display.newCircle( center_x, center_y, clock_radius)<br \/>\nmyCircle:setFillColor(128,128,128)<\/p>\n<p>&#8212; draw hours hand<br \/>\nhour = now.hour<br \/>\nprint(hour)<br \/>\ndegree = -3.14\/2 + (3.14*2\/12)*hour<br \/>\nhours_x = center_x + (clock_radius-50) * math.cos(degree)<br \/>\nhours_y = center_y + (clock_radius-50) * math.sin(degree)<br \/>\nlocal hours_line = display.newLine( center_x,center_y, hours_x,hours_y )<br \/>\nhours_line:setColor( 0, 102, 102, 255 )<br \/>\nhours_line.width = 5<\/p>\n<p>&#8212; draw minutes hand<br \/>\nminute = now.min<br \/>\ndegree = -3.14\/2 + (3.14*2\/60)*minute<br \/>\nmin_x = center_x + (clock_radius-10) * math.cos(degree)<br \/>\nmin_y = center_y + (clock_radius-10) * math.sin(degree)<br \/>\nlocal min_line = display.newLine( center_x,center_y, min_x,min_y )<br \/>\nmin_line:setColor( 255, 102, 102, 255 )<br \/>\nmin_line.width = 5<\/p>\n<p>&#8212; draw second hand<br \/>\nsecond = now.sec<br \/>\ndegree = -3.14\/2 + (3.14*2\/60)*second<br \/>\nsec_x = center_x + (clock_radius-10) * math.cos(degree)<br \/>\nsec_y = center_y + (clock_radius-10) * math.sin(degree)<br \/>\nlocal sec_line = display.newLine( center_x,center_y, sec_x,sec_y )<br \/>\nsec_line:setColor( 1, 1, 1, 255 )<br \/>\nsec_line.width = 5<br \/>\nend<\/p>\n<p>timer.performWithDelay(1000, drawClock, 0)<\/p><\/blockquote>\n\n<!-- Facebook Like Button v1.9.6 BEGIN [http:\/\/blog.bottomlessinc.com] -->\n<iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Finspiredtoeducate.net%2Finspiredtoeducate%2Flearn-how-to-create-a-mobile-app-in-minutes%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light\" scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" style=\"border:none; overflow:hidden; width:450px; height: 30px; align: left; margin: 2px 0px 2px 0px\"><\/iframe>\n<!-- Facebook Like Button END -->\n","protected":false},"excerpt":{"rendered":"<p>Many of my readers may enjoy learning how they can create apps for their favorite mobile devices: ipad, iphone, or Android. \u00a0 \u00a0The Corona SDK provides an elegant framework for quickly creating applications and games. \u00a0 \u00a0I have heard stories of middle school students creating rocking games with this tool. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,5,15,11,3,8,1],"tags":[],"_links":{"self":[{"href":"https:\/\/inspiredtoeducate.net\/inspiredtoeducate\/wp-json\/wp\/v2\/posts\/355"}],"collection":[{"href":"https:\/\/inspiredtoeducate.net\/inspiredtoeducate\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inspiredtoeducate.net\/inspiredtoeducate\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inspiredtoeducate.net\/inspiredtoeducate\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/inspiredtoeducate.net\/inspiredtoeducate\/wp-json\/wp\/v2\/comments?post=355"}],"version-history":[{"count":7,"href":"https:\/\/inspiredtoeducate.net\/inspiredtoeducate\/wp-json\/wp\/v2\/posts\/355\/revisions"}],"predecessor-version":[{"id":359,"href":"https:\/\/inspiredtoeducate.net\/inspiredtoeducate\/wp-json\/wp\/v2\/posts\/355\/revisions\/359"}],"wp:attachment":[{"href":"https:\/\/inspiredtoeducate.net\/inspiredtoeducate\/wp-json\/wp\/v2\/media?parent=355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inspiredtoeducate.net\/inspiredtoeducate\/wp-json\/wp\/v2\/categories?post=355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inspiredtoeducate.net\/inspiredtoeducate\/wp-json\/wp\/v2\/tags?post=355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}