{"id":1970,"date":"2013-10-27T07:47:20","date_gmt":"2013-10-26T19:47:20","guid":{"rendered":"https:\/\/www.deltics.co.nz\/blog\/?p=1970"},"modified":"2013-10-29T06:42:39","modified_gmt":"2013-10-28T18:42:39","slug":"platform-ignorants","status":"publish","type":"post","link":"https:\/\/www.deltics.co.nz\/blog\/posts\/1970\/","title":{"rendered":"Platform Ignorants"},"content":{"rendered":"<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">[Estimated Reading Time: <\/span> <span class=\"rt-time\">3<\/span> <span class=\"rt-label rt-postfix\">minutes]<\/span><\/span><p>A while ago Marco Cantu posted about an issue with implementing ShowModal in FireMonkey, specifically with reference to <a href=\"http:\/\/blog.marcocantu.com\/blog\/xe5_anonymous_showmodal_android.html\">the difficulties this entailed on iOS and Google Android platforms<\/a>.  Chris Rolliston recently picked this same topic up and highlighted some <a href=\"http:\/\/delphihaven.wordpress.com\/2013\/10\/26\/new-showmodal-overload\/\">problems that still remain in the FireMonkey &#8220;solution&#8221;<\/a>.  Both Marco and Chris however have missed a key point.<\/p>\n<p>Neither Google nor Apple are stupid.<\/p>\n<p><!--more--><\/p>\n<p>If modal dialogs are &#8220;difficult&#8221; on their platforms, perhaps there is a good reason for this ?<\/p>\n<p>And if you stop and think about a mobile computing platform properly, rather than simply trying to steam-roller a desktop application model onto it on the coat-tails of a cross-platform graphics rendering engine, the problems become obvious.<\/p>\n<h2>User Dialogues<\/h2>\n<p>On a desktop computer if I am working with an application and that application requires a <strong>modal dialogue<\/strong> with the user then it makes perfect sense to do so.  The application cannot proceed until the <strong>dialogue<\/strong> has completed.<\/p>\n<p>Note that I use the <strong>dialogue<\/strong> spelling here to emphasise the fact that I am talking about the concept of a <em>conversation with a user<\/em>, not a specific software\/UI technology that implements that concept.<\/p>\n<p>On the desktop, such conversations will not (other than in exceptional circumstances) be interrupted.  Even if the user is distracted, goes away, perhaps performs some other task (even on the same computer), when they return to that application it will still be there, waiting patiently for them to respond and to complete the dialogue.<\/p>\n<p>The user can even switch off their computer and if they use the &#8220;hibernation&#8221; facility of their system then the application, patiently waiting for their response, will still be patiently waiting when it has been restored from it&#8217;s hibernated state.<\/p>\n<p>And the application developer gets all this for free with a simple <strong>ShowModal<\/strong> call.<\/p>\n<p>Mobile platforms are somewhat different.<\/p>\n<h2>User Interrupted<\/h2>\n<p>Even as well specified as they often are, mobile devices are far more resource constrained, relatively speaking, than desktop systems and the operating systems far more aggressive in limiting wasteful use of those resources.<\/p>\n<p>As a result, a conversation can be simply cut off by the system if the user does not respond in a timely fashion.<\/p>\n<p>On mobile platforms, long running user dialogues make very little sense and tend to be limited to much shorter exchanges obtaining simple responses from a user.  Pick from a list, confirm or reject an option etc etc.<\/p>\n<p>And even here, if the user doesn&#8217;t pick from the list or confirm the option, well.. so what ?  Obviously it wasn&#8217;t important enough for the user to do so at that time and the application must and will allow for that.<\/p>\n<p>More crucially, in a long running conversation if a user is distracted and switches to some other application then in the meantime the system may decide that the dialogue with the original application was not important enough and <em>sweep the entire thing away to make room for other things that are more important<\/em> (i.e. what the user is actually working with <em>right now<\/em>).<\/p>\n<p>There are obvious good reasons for this.<\/p>\n<p>Users don&#8217;t even seem to mind.  They have accepted this behaviour of mobile applications without fuss or bother.<\/p>\n<p>In part this is because some applications can maintain an illusion of modality, using the platform behaviours that the platform designers thoughtfully provided.<\/p>\n<p>If a dialogue with a user is sufficiently important then an application can respond to being cleaned up by the system and (if it is important to do so) can save information about the current state of that dialogue which will allow it to resume that state when the user returns (re-starts) the application.<\/p>\n<p>But sitting there presenting a blocked UI would prevent the system from cleaning up such an application.<\/p>\n<p>Or rather, it would require that to do so would involve having a facility for hibernating and resuming an applications <em>entire state<\/em>, rather than simply flushing it and leaving it to resume into whatever state the application deems appropriate.<\/p>\n<p>Again, there are obvious reasons why such an approach would be impractical and undesirable on a mobile device.<\/p>\n<h2>Platform Ignorance<\/h2>\n<p>But as even this simple case demonstrates <strong>FireMonkey<\/strong> isn&#8217;t concerned with fostering, encouraging or in some cases even <em>supporting<\/em> correct behaviour on mobile platforms.  It is concerned only with allowing developers to code in ignorance of such concerns.<\/p>\n<p>It&#8217;s all about whether <strong>FireMonkey<\/strong> <em>can<\/em> do something and never about whether it <strong><em>should<\/em><\/strong>.<\/p>\n<p>It also means studiously ignoring all the things that <strong>FireMonkey<\/strong> simply cannot do that users of the &#8220;supported&#8221; platforms expect.  On Android this means obvious things like <strong>Services<\/strong> and <strong>AppWidgets<\/strong>, and less obvious things like using the system provided <strong>AlarmManager<\/strong> to reliably and (more importantly) efficiently invoke application behaviours at scheduled times.<\/p>\n<p>In doing so, it does those developers &#8211; not to mention the users of those developers&#8217; applications &#8211; a <em>great<\/em> disservice.<\/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\">3<\/span> <span class=\"rt-label rt-postfix\">minutes]<\/span><\/span> A while ago Marco Cantu posted about an issue with implementing ShowModal in FireMonkey, specifically with reference to the difficulties this entailed on iOS and Google Android platforms. Chris Rolliston recently picked this same topic up and highlighted some problems that still remain in the FireMonkey &#8220;solution&#8221;. Both Marco and Chris however have missed a [&hellip;]<\/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":[4],"tags":[292,135],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1TKYv-vM","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":735,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/735\/","url_meta":{"origin":1970,"position":0},"title":"RAD STUDIO XE2: Launch Event Report","date":"04 Aug 2011","format":false,"excerpt":"Today I was fortunate to be present in Auckland at the World Premier of the launch event for RAD Studio XE2. \u00a0There is so much good to report that I really don't know where to begin, so apologies if this post is a bit of a disorganised ramble. \u00a0But here\u2026","rel":"","context":"In &quot;Delphi&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2104,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/2104\/","url_meta":{"origin":1970,"position":1},"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":[]},{"id":892,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/892\/","url_meta":{"origin":1970,"position":2},"title":"Poll: FireMonkey or &#8220;Platform Native&#8221; ?","date":"07 Jun 2012","format":false,"excerpt":"We have had almost a year of monkeying with fire now - enough time I think for people to have formed a view as to whether it is truly a viable multi-platform framework for the future, or just a convenient cross-platform solution with limited, genuine utility. At the same time,\u2026","rel":"","context":"In &quot;Delphi&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1525,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1525\/","url_meta":{"origin":1970,"position":3},"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":943,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/943\/","url_meta":{"origin":1970,"position":4},"title":"FireMonkey to Support Native Controls","date":"02 Aug 2012","format":false,"excerpt":"In the comments to my previous post, David Intersimone mentioned that Embarcadero are working on enabling support for platform native UI controls within FireMonkey! The team is working to surface native controls for FireMonkey on each platform. Then developers will have the choice to use vector drawn components in their\u2026","rel":"","context":"In &quot;Delphi&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1601,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1601\/","url_meta":{"origin":1970,"position":5},"title":"iOS 6.x Now Required By FireMonkey in XE5","date":"14 Sep 2013","format":false,"excerpt":"In XE4 FireMonkey supported iOS 5.1. According to the platform requirements for XE5 this has now increased to iOS 6. This something to be aware of. Even if your application could run on older, simpler devices, the FireMonkey runtime has demands of it's own, over and above those of any\u2026","rel":"","context":"In &quot;Delphi&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/1970"}],"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=1970"}],"version-history":[{"count":4,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/1970\/revisions"}],"predecessor-version":[{"id":1984,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/1970\/revisions\/1984"}],"wp:attachment":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/media?parent=1970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/categories?post=1970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/tags?post=1970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}