{"id":768,"date":"2012-08-31T07:26:39","date_gmt":"2012-08-31T13:26:39","guid":{"rendered":"http:\/\/cbateman.com\/blog\/?p=768"},"modified":"2012-10-27T19:43:14","modified_gmt":"2012-10-28T01:43:14","slug":"an-html5-based-ios-app","status":"publish","type":"post","link":"https:\/\/cbateman.com\/blog\/an-html5-based-ios-app\/","title":{"rendered":"An HTML5-Based iOS App"},"content":{"rendered":"<p><strong>Short version<\/strong>: I built an HTML5-based iOS app, and you can download it <a href=\"http:\/\/itunes.apple.com\/us\/app\/bright-lights!\/id553406055\">here<\/a>.<\/p>\r\n\r\n<p><strong>Long Version<\/strong>: A while ago I decided to build a particle system in JavaScript with the canvas element. This is certainly nothing original, but I thought it would be both fun and a good learning experience. I&#8217;d planned to just post it on my blog and move on. It turned out that it was a lot of fun, and it was a great learning experience.<\/p>\r\n\r\n<p>But when I implemented touch events and tried it on my iPad, I immediately discovered that it was insanely more fun with multi-touch than it was with a mouse. Of course I could have just made it a web app and left it at that, but I&#8217;d been looking for an excuse to experiment with the Apple App Store, so I decided this would be it.<\/p>\r\n\r\n<p>I&#8217;ve never approved of HTML-based apps that attempt to replicate native look-and-feel or native functionality. It can be done, but it usually just results in the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Uncanny_valley\">uncanny valley<\/a>: glitchy page transitions, scrolling that doesn&#8217;t feel right, and components that look like they came from the previous OS version.<\/p>\r\n\r\n<p>So my first requirement was that it be indistinguishable from a native app. I think I&#8217;ve mainly accomplished that, which I&#8217;m pretty happy about. And fortunately, a canvas-based app makes it easy to stay away from native look-and-feel.<\/p>\r\n\r\n<p>But the big downside of doing this with JavaScript is that the performance is nowhere near as good as native code would be, especially <a href=\"http:\/\/daringfireball.net\/2011\/03\/nitro_ios_43\">without Nitro in webviews<\/a>. I wasn&#8217;t able to get performance where it needed to be on older devices, so I ended up restricting it to iPhone 4+ and iPad 2+. My apologies to those of you with older devices.<\/p>\r\n\r\n<p>I know I could have built it with native code and gotten amazing performance on older devices &#8211; but I frankly just don&#8217;t have time to really learn another platform. It&#8217;s hard enough to <a href=\"http:\/\/cbateman.com\/blog\/focus\/\">keep up with the web<\/a>, and that&#8217;s where I want to stay focused.<\/p>\r\n\r\n<p>One more apology: I&#8217;m charging $0.99 for it, mainly because I&#8217;d like to get back some of the developer license cost. I&#8217;m planning to make some enhancements to it, and in a year or so I&#8217;ll probably make it free. If you do try it out, please let me know what you think!<\/p>\r\n\r\n<p style=\"text-align:center;\"><a href=\"http:\/\/itunes.apple.com\/us\/app\/bright-lights!\/id553406055\"><img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/2012\/10\/download_app.png\" alt=\"Available on the App Store\" width=\"170\" height=\"50\" \/><\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Short version: I built an HTML5-based iOS app, and you can download it here. Long Version: A while ago I decided to build a particle system in JavaScript with the canvas element. This is certainly nothing original, but I thought it would be both fun and a good learning experience. I&#8217;d planned to just post it on my blog and&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-768","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/posts\/768"}],"collection":[{"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/comments?post=768"}],"version-history":[{"count":35,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/posts\/768\/revisions"}],"predecessor-version":[{"id":809,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/posts\/768\/revisions\/809"}],"wp:attachment":[{"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/media?parent=768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/categories?post=768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/tags?post=768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}