{"id":1660,"date":"2013-09-19T10:42:59","date_gmt":"2013-09-18T22:42:59","guid":{"rendered":"https:\/\/www.deltics.co.nz\/blog\/?p=1660"},"modified":"2013-09-19T10:42:59","modified_gmt":"2013-09-18T22:42:59","slug":"fair-comparisons","status":"publish","type":"post","link":"https:\/\/www.deltics.co.nz\/blog\/posts\/1660\/","title":{"rendered":"Fair Comparisons"},"content":{"rendered":"<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">[Estimated Reading Time: <\/span> <span class=\"rt-time\">5<\/span> <span class=\"rt-label rt-postfix\">minutes]<\/span><\/span><p>There is an old saying about comparing &#8220;apples and apples&#8221; or more accurately in this case, &#8220;Androids and Androids&#8221;.  A commenter has already pointed out that an Embarcadero blog post <a href=\"http:\/\/blogs.embarcadero.com\/davidi\/2013\/09\/17\/42869\">referencing the &#8220;effort&#8221; described by my series of posts<\/a> demonstrating how to build a camera app for Android using Oxygene was <a href=\"http:\/\/blogs.embarcadero.com\/davidi\/2013\/09\/17\/42869#comment-85768\">not a fair comparison<\/a>.<\/p>\n<p><!--more--><\/p>\n<p>Despite having specifically drawn attention to the amount of code involved, the author of the post is <a href=\"http:\/\/blogs.embarcadero.com\/davidi\/2013\/09\/17\/42869#comment-85787\">now claiming that the focus of his post was not actually the focus of his post<\/a>.<\/p>\n<p>In that post, to demonstrate what was not his point and not intending to show how little code was needed to achieve what he implied was the same thing using the FireMonkey runtime, he pointed to <a href=\"http:\/\/docwiki.embarcadero.com\/RADStudio\/XE5\/en\/Mobile_Tutorial:_Taking_and_Sharing_a_Picture_(iOS_and_Android)\">one of the tutorials included with XE5<\/a>.<\/p>\n<p>Unfortunately in his rush to sell the benefits of FireMonkey, he missed a key difference and neglected to mention a key fact.<\/p>\n<h3>Vive La Difference<\/h3>\n<p>The difference he missed was that so far in my series I have not actually reached the point where we take a picture with the camera.<\/p>\n<p>&#8220;<em>AHA<\/em>!&#8221; goes up the cry.  &#8220;<em>Then it&#8217;s even worse with Oxygene!  You have done all that work and haven&#8217;t even got as far as taking the picture!  This shows the superior productivity of FireMonkey, confirming David&#8217;s point, surely ?<\/em>&#8221;<\/p>\n<p>Not so fast.  There are a few things missing in that tutorial he cites.<\/p>\n<p>One thing it does <strong>not<\/strong> demonstrate and what David did <strong>not<\/strong> mention, is how to configure a FireMonkey application to indicate dependency on the presence of a camera.  Or how to state the permissions required by such an application (access to the camera and the ability to write to device storage &#8211; if you wish to save the image).<\/p>\n<p>Those are the things covered in <strong><a href=\"https:\/\/www.deltics.co.nz\/blog\/posts\/1605\">Part 1<\/a><\/strong> of my tutorial.  It is important not to confuse the amount of detail in the coverage with the amount of effort involved.<\/p>\n<p>The building of the UI was similarly almost incidental and no more arduous to craft in XML in my view than dropping a bunch of components and then navigating your way through a bunch of properties and dialogs to set them up.  Code Completion won&#8217;t help you find the right property to set.  It will help you write the correct XML.<\/p>\n<p>I strongly suspect that creating the XML was actually quicker, and I say that as someone who believes that XML is proof that there <em>is<\/em> a God since the Devil &#8211; and thus XML &#8211; would not otherwise exist!  \ud83d\ude09<\/p>\n<p>Admittedly, a text editor is not as <em>pretty<\/em> as a cosmetically skinned form designer.  But I thought the point here was productivity, not a beauty contest.<\/p>\n<h3>Fit and Finish<\/h3>\n<p>And of course, the tutorial completely ignores the question of ensuring your UI &#8220;fits&#8221; the expectations of the users on different platforms (or indeed on different sized devices on the <em>same<\/em> platform).  It assumesyou will simply use the identical UI on all platforms.<\/p>\n<p>The native platform tools provide explicit support for this which FireMonkey cannot take advantage of and (as yet at least) provides no equivalent.  You will need separate forms for different layouts with at least some duplication of code.  But hey, it&#8217;s still &#8220;one codebase&#8221;, nobody said it would be a maintainable codebase.  \ud83d\ude09<\/p>\n<p>I guess we are just ignoring such niceties as making sure our apps look and feel right for each platform, even though it&#8217;s one of the &#8220;<strong>Top 5 Mistakes<\/strong>&#8221; to avoid, at least, according to a presentation I saw recently. \ud83d\ude09<\/p>\n<p>Of course, multi-platform issues are not addressed in my series of articles because I&#8217;m not writing a multi-platform application and not claiming to do so.  But if you are going to claim that an approach solves this problem in addition to others then this really needs to be substantiated if not  demonstrated.<\/p>\n<h3>The Missing View<\/h3>\n<p>So moving on from UI issues, <strong><a href=\"https:\/\/www.deltics.co.nz\/blog\/posts\/1624\">Part 2<\/a><\/strong> of the series was about code, but it didn&#8217;t represent any &#8220;work&#8221; at all.  It was a discussion piece, exploring one of the advanced language features in Oxygene that makes working so directly and closely with the Java Android SDK such a delight in comparison to using Java.<\/p>\n<p><strong><a href=\"https:\/\/www.deltics.co.nz\/blog\/posts\/1634\">Part 3<\/a><\/strong> <em>did<\/em> involve a bit of work, though really not very much.  In terms of code, establishing the <strong>live viewfinder<\/strong> functionality was trivial.  The bulk of the effort went into ensuring that the viewfinder image was oriented correctly with respect to the physical device orientation and even that was primarily some trivial math.  This seems to be an issue which caused some confusion for <strong>Tim DelChiaro<\/strong> <a href=\"http:\/\/edn.embarcadero.com\/article\/41881\">when capturing images during his own demonstration of building a camera app using XE2<\/a>.  Or perhaps that was just a bug in FireMonkey at the time ?  Either way, perhaps he would have realised what was going on if he had been working more directly with the platform API&#8217;s, rather than at arms length using the FireMonkey <a href=\"http:\/\/en.wikipedia.org\/wiki\/Remote_manipulator\">waldo<\/a> ?<\/p>\n<p>But of more relevance &#8211; and significance &#8211; is that the tutorial David I references <strong>does not include <em>any<\/em> form of live viewfinder support at all<\/strong>.  There is a button for taking a picture but as far as I can tell, you do not see what you are getting until you press that button.<\/p>\n<p>Fair&#8217;s fair.  Let&#8217;s see what&#8217;s involved in achieving a live camera preview &#8211; correctly oriented &#8211; in FireMonkey before we start knocking the alternative as &#8220;less productive&#8221;, shall we ?<\/p>\n<p>Maybe it <strong>is<\/strong> easier and more straightforward, but I don&#8217;t think we can just take it as a given.<\/p>\n<p>Of course that wasn&#8217;t the author&#8217;s only point.  There was another point dropped in as a final sentence of a paragraph dominated by the amount of code involved.  This final sentence apparently was the main point.<\/p>\n<p>That this same app would work, as is, unaltered, with just a simple recompilation required, on both iOS and Android.<\/p>\n<p>Which may even be true.  As long as you are just doing a demo, ignoring getting your platform specific settings right and aren&#8217;t concerned with ensuring a platform-correct look and feel.<\/p>\n<p>But <em>apart<\/em> from that extra work to take into account there is no extra work to take into account.  \ud83d\ude09<\/p>\n<h3>Develop Applications Quickly!  Working Ones?  Oh<\/h3>\n<p>A comment has subsequently appeared on David I&#8217;s own post from what appears to be a quite frustrated developer that seems to have been involved in the beta program.  <a href=\"http:\/\/blogs.embarcadero.com\/davidi\/2013\/09\/17\/42869#comment-85718\">The commenter complains that a known issue that prevents access to the camera on some Android devices still does not appear to have been resolved<\/a>.<\/p>\n<p>I hope this commenter does not get into trouble for what looks like a violation of the beta NDA.  It wouldn&#8217;t really be fair now that the state of FireMonkey is out from behind the cover of the beta.<\/p>\n<p>Is this one of the known issues that some people have suggested were ignored in the rush to get a product released ?  It&#8217;s certainly just one of a number of quite painful bugs that still plague the FireMonkey runtime framework.<\/p>\n<p>I don&#8217;t have time to compile links and list them all, but this <a href=\"https:\/\/plus.google.com\/u\/0\/s\/delphi%20xe5%20bug\">search of Google+<\/a> throws up some of them.<\/p>\n<p>One particularly nasty one does deserve special mention I think: a <a href=\"http:\/\/qc.embarcadero.com\/wc\/qcmain.aspx?d=118923\">catastrophic texture memory leak<\/a>.<\/p>\n<p>In case anyone gets the wrong idea, this is not to say that Oxygene is a pristine example of bug free software nirvana.  <a href=\"https:\/\/www.deltics.co.nz\/blog\/posts\/1562\">I already posted about my experiences in that regard<\/a>.<\/p>\n<p>How long will people have to wait for their first FireMonkey hot-fix I wonder ?  Never mind hot-fixes or updates, in some cases people have been waiting for some of those bugs to be fixed for not just one version but two or more.<\/p>\n<p>In any event, I do not quite think it fair to mock a solution based on an alternative technology <em>which works<\/em> with a <em>less capable<\/em> one which &#8211; even as simple as it is &#8211; does not appear to work consistently or reliably on even the subset of devices that are supported.<\/p>\n<p>It seems to me that it doesn&#8217;t much matter how quickly you can write an app if you can&#8217;t be sure it&#8217;s going to even work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">[Estimated Reading Time: <\/span> <span class=\"rt-time\">5<\/span> <span class=\"rt-label rt-postfix\">minutes]<\/span><\/span> There is an old saying about comparing &#8220;apples and apples&#8221; or more accurately in this case, &#8220;Androids and Androids&#8221;. A commenter has already pointed out that an Embarcadero blog post referencing the &#8220;effort&#8221; described by my series of posts demonstrating how to build a camera app for Android using Oxygene was not a fair comparison.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[212,4],"tags":[153,218,292],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1TKYv-qM","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1525,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1525\/","url_meta":{"origin":1660,"position":0},"title":"RAD Studio in Auckland \/ Android in a VM \/ Touchy Feely","date":"30 Aug 2013","format":false,"excerpt":"Well, not really RAD Studio as such, more like Mobile Studio (whether as part of RAD Studio Ent+ or the Mobile Add-On) since everything shown was oriented around the Android support and emphasising the fact that an application written for iOS can simply be recompiled and will run on Android.\u2026","rel":"","context":"In &quot;Delphi&quot;","img":{"alt_text":"Androidx86","src":"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Androidx86-1024x608.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1414,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1414\/","url_meta":{"origin":1660,"position":1},"title":"It&#8217;s a Good Time for NZ Delphi Users to Cross-Grade","date":"02 May 2013","format":false,"excerpt":"Having lost our Delphi reseller in NZ last year, and with the Kiwi dollar riding high against the US dollar, now is a good time to make purchases from online stores operating in US currency. RemObjects has such a store and they also have a cross-grade offer for Delphi customers\u2026","rel":"","context":"In &quot;Delphi&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1817,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1817\/","url_meta":{"origin":1660,"position":2},"title":"Getting the Battery Level on Android With Delphi","date":"01 Oct 2013","format":false,"excerpt":"Over the past few days I posted a two part series showing how to obtain the current battery level as part of the implementation of an Android AppWidget using Oxygene. As far as I can tell AppWidgets simply aren't possible using Delphi but reading the battery is quite straightforward Android\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2231,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/2231\/","url_meta":{"origin":1660,"position":3},"title":"Did you get the Memo ?","date":"01 Aug 2014","format":false,"excerpt":"People looking for a cheap Android tablet have a new option from a respected player: The Asus Pad 7 Although not exactly falling over themselves in excitement (it is an entry level, budget device after all), reviewers are finding a lot to like in this device. But Delphi developers hoping\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2086,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/2086\/","url_meta":{"origin":1660,"position":4},"title":"ADB WINLOG 1.0.1 &#8211; RELEASED!","date":"04 Nov 2013","format":false,"excerpt":"Are you doing Android development ? Whether you are using Delphi or some other Android development tool a key tool in the Android developer's toolbox is the logcat command, part of the Android SDK. But it can be a little... how to put this kindly... crude. So I put together\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"ADB WINLOG 1.0.1","src":"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Screen-Shot-2013-11-03-at-19.56.37-.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2104,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/2104\/","url_meta":{"origin":1660,"position":5},"title":"Delphi for Android Supports Android!","date":"07 Nov 2013","format":false,"excerpt":"Jim McKeeth is getting all excited about being able to develop for Google Glass using Delphi XE5. I'm pleased for him, I really am. It must be a huge relief that Delphi for Android can actually target this Android device. Of course, the very fact that there was any doubt\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/1660"}],"collection":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/comments?post=1660"}],"version-history":[{"count":10,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/1660\/revisions"}],"predecessor-version":[{"id":1690,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/1660\/revisions\/1690"}],"wp:attachment":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/media?parent=1660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/categories?post=1660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/tags?post=1660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}