{"id":1525,"date":"2013-08-30T19:12:26","date_gmt":"2013-08-30T07:12:26","guid":{"rendered":"https:\/\/www.deltics.co.nz\/blog\/?p=1525"},"modified":"2013-08-30T19:12:26","modified_gmt":"2013-08-30T07:12:26","slug":"rad-studio-in-auckland-android-in-a-vm-touchy-feely","status":"publish","type":"post","link":"https:\/\/www.deltics.co.nz\/blog\/posts\/1525\/","title":{"rendered":"RAD Studio in Auckland \/ Android in a VM \/ Touchy Feely"},"content":{"rendered":"<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">[Estimated Reading Time: <\/span> <span class=\"rt-time\">7<\/span> <span class=\"rt-label rt-postfix\">minutes]<\/span><\/span><p>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.  Or Windows or OS X, as before of course.  About which nothing was said (or, to be fair, asked either).<\/p>\n<p><!--more--><\/p>\n<p>As such, there&#8217;s really not much to be said that hasn&#8217;t already been said in other World Tour Reports and that had not already been anticipated.<\/p>\n<p>The Android support works as expected and, as expected, from my perspective, it is an extremely pessimistic expectation that it works toward.  Namely, there seems to be no appetite for attracting new users to Delphi.<\/p>\n<p>Some mention was made of &#8220;talking to universities&#8221; but frankly with the approach they have taken I do not think they will get anywhere with this.  Universities are increasingly concerned with commercial relevance and FireMonkey simply isn&#8217;t going to score highly in that department.<\/p>\n<p>The emphasis seems to be &#8220;<em>use what you know to do this new stuff<\/em>&#8221; and not as much &#8220;<em>we believe we have a compelling story to tell to all mobile developers<\/em>&#8220;.  Some numbers suggesting the advantage in reduced team sizes and development costs of using Delphi were thrown up on the slides at one point but at this stage any such numbers are entirely theoretical, given that there aren&#8217;t any established ISV&#8217;s using Delphi to support a range of mobile platforms with which to compare, like for like, with the established successful multi-platform development sites.<\/p>\n<p>The problem I see them having in taking their story beyond the borders of the existing Delphi user base is that once you scratch beneath the &#8220;one codebase&#8221; headline, the shortcomings and compromises are quickly exposed.  <\/p>\n<p>Now, whether those <em>matter<\/em> is a subjective question.<\/p>\n<p>My guess is that it will matter more to mobile developers, as distinct from Delphi developers looking to do a bit of mobile.<\/p>\n<h3>Going Native<\/h3>\n<p>The word &#8220;native&#8221; was predictably ever present, sometimes attached to the word &#8220;code&#8221; and sometimes to the word &#8220;style&#8221;.  But I am still not convinced.  I think &#8220;native&#8221; is like what they say about &#8220;sex&#8221;.  Anyone talking about it all the time usually isn&#8217;t doing it.  \ud83d\ude42<\/p>\n<p>It can be argued both ways, but for my money Embarcadero&#8217;s interpretation of &#8220;native&#8221; doesn&#8217;t work for me.  Yes it&#8217;s unmanaged code, which is what we tended to mean when we were comparing .NET vs Win32 on Windows for example.  The problem being that &#8220;unmanaged&#8221; also happened to coincide with &#8220;native&#8221; on that platform.  .NET was a runtime that sat &#8211; for the most part &#8211; on top of the OS.  With the mobile platforms there really isn&#8217;t as much &#8211; if any &#8211; distinction between the managed runtimes and the platforms they support.  They are, in a very real sense, the platform.<\/p>\n<p>On Android in particular, Java is the <em>native environment<\/em> even though it involves a managed runtime (Dalvik).  There is something that illustrates the distinction quite well I think.  Consider this screenshot:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Androidx86.png?ssl=1\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Androidx86.png?resize=500%2C296&#038;ssl=1\" alt=\"Androidx86\" width=\"500\" height=\"296\" class=\"aligncenter size-large wp-image-1526\" srcset=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Androidx86.png?resize=1024%2C608&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Androidx86.png?resize=300%2C178&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Androidx86.png?resize=500%2C297&amp;ssl=1 500w, https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Androidx86.png?w=1537&amp;ssl=1 1537w, https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Androidx86.png?w=1280&amp;ssl=1 1280w\" sizes=\"(max-width: 500px) 100vw, 500px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>This shows a debug session of a simple Android application (the Oxygene <em>Android Application<\/em> template in fact) and the Android VM (a <em>Parallels Desktop<\/em> instance) that the application is running in.<\/p>\n<p>In the Visual Studio tool bar you will see &#8220;<strong>CrossBox: Local: 192.168.1.16:5555<\/strong>&#8220;.  This indicates that the debugger is attached to the Android device (the VM) at that address.  Essentially CrossBox is to Oxygene as PA Server is to Delphi.<\/p>\n<p>If I had a physical device connected then the device ID would be shown rather than an IP address.  An IP address is involved here because I am debugging in a virtual machine.  Not the Android <em>emulator<\/em>, but another Parallels VM instance, running an installation of Android-X86.  That&#8217;s Android running on an Intel X86 processor (albeit virtualised in this particular case).<\/p>\n<p>Obviously I cannot attach a USB cable between two VM&#8217;s, but fortunately the Android debugger is prepared for this.  I simply need the IP address of the Android VM (obtainable from the Tablet Status info) and then run:<\/p>\n<pre>\r\n<strong>adb connect <em>&lt;ip address&gt;<\/em><\/strong>\r\n<\/pre>\n<p>In a Windows command prompt.  At which point my Android VM is detected and presented as a debug target by Crossbox.  The Android machine that my application then runs on is a virtualised Intel x86 machine running my Android application.<\/p>\n<p>As far as I know, you cannot do this with a compiler that emits a Java stub that then bootstraps into native ARM code.  The Java stub will run but then fall flat on it&#8217;s face when it tries to run ARM instructions on an X86 processor.<\/p>\n<p>But I do not have XE5 &#8211; not even in beta &#8211; to actually try this.<\/p>\n<h3>The Java, the Whole Java and Nothing But the Java<\/h3>\n<p>For those who for some reason still aren&#8217;t aware, you will also notice that the source code of this Android application is very much <strong>Pascal<\/strong>.  Not <em>Java<\/em>.  The &#8220;<em>for Java<\/em>&#8221; part of Oxygene Cooper refers to the fact that the compiler emits Java byte code out of its rear end, instead of X86 instructions and has nothing to do with the language.<\/p>\n<p>It also extends to the fact that the compiler is able to make use of other Java libraries directly.  No need for wrappers or other shenanigans to &#8220;get at&#8221; the underlying platform.<\/p>\n<p>Furthermore, there is no supplementary framework required to make this application <strong>run<\/strong>.   No <strong>mono.NET<\/strong> (as some people seem to think is required by Oxygene) or any other framework beyond that provided by the platform itself.<\/p>\n<p>It is an Android application pure and simple.<\/p>\n<p>Very simple in fact.<\/p>\n<p>&#8220;How simple ?&#8221; you ask &#8230;<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/HelloAndroidSize.png?ssl=1\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/HelloAndroidSize.png?resize=300%2C232&#038;ssl=1\" alt=\"HelloAndroidSize\" width=\"300\" height=\"232\" class=\"aligncenter size-medium wp-image-1528\" srcset=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/HelloAndroidSize.png?resize=300%2C232&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/HelloAndroidSize.png?resize=387%2C300&amp;ssl=1 387w, https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/HelloAndroidSize.png?w=800&amp;ssl=1 800w\" sizes=\"(max-width: 300px) 100vw, 300px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>48KB simple.  <strong>That&#8217;s<\/strong> how simple.<\/p>\n<p>We did not get shown how big a &#8220;Hello World&#8221; Android application is in Delphi, but with the need to drag along the FireMonkey platform, I doubt anyone would take a bet that it won&#8217;t be an order (or orders) of magnitude larger than 48KB.<\/p>\n<h3>Touchy Feely Lookey Likey<\/h3>\n<p>One of the &#8220;5 mistakes to avoid&#8221; suggested for mobile developers was forgetting the user experience.  That is, if your app does not look and feel like an app that the user is used to, they likely will not want to use it.<\/p>\n<p>Your apps must look at home on their devices.<\/p>\n<p>And FireMonkey helps you do this right?  With all it&#8217;s pixel-perfect bitmap styles and what have you.  No?<\/p>\n<p>Well yes.  And no.  Consider the humble Tab Bar.<\/p>\n<p>A Tab Bar in a FireMonkey application will certainly change it&#8217;s appearance to suit either Android or iOS as appropriate, thanks to the different styles that can be applied.  But it won&#8217;t change it&#8217;s position.<\/p>\n<p>On iOS, the convention &#8211; and the user expectation &#8211; is that a Tab Bar is positioned at the bottom of the screen.  On Android, not only does the Tab Bar look different but it is positioned at the <strong>top<\/strong> of the screen.<\/p>\n<p>This is in fact the subject of <a href=\"http:\/\/stackoverflow.com\/questions\/2677698\/android-iphone-style-tabhost\">a question on stack overflow<\/a>, posted by someone seemingly intent on breaking the rule of User Expectations (which also illustrates the difference between iOS and Android tab bars for those not familiar.<\/p>\n<p>With FireMonkey, if you want your application to reconfigure itself for the different platforms then you will have to either:<\/p>\n<ul>\n<li>Write code to manipulate your UI (or construct it) to reflect differences in the platforms at runtime<\/li>\n<\/ul>\n<p>or<\/p>\n<ul>\n<li>Maintain different forms for each different platform<\/li>\n<\/ul>\n<p>The same applies not just for different platforms but for different <em>devices<\/em> on the <em>same<\/em> platform.  An application UI designed for an Android or iOS tablet will rarely simply scale down to a phone, or sometimes not even to a smaller tablet\/phablet.<\/p>\n<p>Each difference in layout, whether to reflect device or platform, will mean code to modify the layout or different forms.  Unlike the form design infrastructure provided by the iOS and Android platforms, where the form layout is free of code and (largely) decoupled from your application behaviours, a form in Delphi and FireMonkey is full of code, even if only simple code to invoke more complex behaviours in business objects.<\/p>\n<p>You may indeed have only &#8220;one codebase&#8221; from which to generate all your different versions of your application for different platforms and devices, but I suspect that (if you are to get a worthwhile result) you will end up writing a lot of code simply to manage the user interface and not at all related to the business of your app.<\/p>\n<p>If, that is, you wish to do mobile properly.<\/p>\n<p>It should be mentioned at this point that we were told that a brand new form designer is in the works for Delphi that will apparently address at least some of these issues, though <strong>how<\/strong> was not explained and neither was <strong>when<\/strong> mentioned (but the impression I got was that it is not something you can expect in XE5).<\/p>\n<p>Finally on this note, it was mentioned that iOS 7 support will be offered &#8220;very quickly&#8221; by Embarcadero, once it is finalised by Apple.  In current beta&#8217;s the look and feel is seemingly still being refined and each time there is an update there is a graphic designer in Embarcadero whose job it is to tweak the iOS styles for FireMonkey to reflect those changes.<\/p>\n<p>Let&#8217;s think about that for a minute:<\/p>\n<p>iOS 7 &#8220;support&#8221; is dependent upon&#8230; a graphic designer.<\/p>\n<p>Meanwhile, if you are using Delphi for iOS you will already have an Apple iOS Developer subscription.<\/p>\n<p>You will already be receiving &#8211; or able to obtain &#8211; iOS 7 beta SDKs.<\/p>\n<p>Of course, you still need that Apple subscription even if you are using Xcode or even Oxygene but in both of those cases you can get cracking with creating iOS 7 applications, complete with the actual iOS 7 look and feel, as soon as you get the SDK&#8217;s from Apple (we&#8217;re up to beta 6 of iOS 7 already).<\/p>\n<h3>The Final Stage:  Acceptance<\/h3>\n<p>It seems now unavoidably the case that Embarcadero are not concerned with securing the future of Delphi by attracting new users, or if they are then they have a very strange way of going about it which is doomed to fail.  Which throws the longer term future of Delphi into serious doubt imho, irrespective of the technical merits &#8211; or otherwise &#8211; or quality of the delivery.<\/p>\n<p>We used to joke that Delphi was the new COBOL.<\/p>\n<p>Sadly, we don&#8217;t joke about it any more.<\/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\">7<\/span> <span class=\"rt-label rt-postfix\">minutes]<\/span><\/span> 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. Or Windows or OS X, [&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,180,207],"tags":[153,292,208],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1TKYv-oB","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1452,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1452\/","url_meta":{"origin":1525,"position":0},"title":"XE5 News: Coming in September, With Android Support","date":"09 Aug 2013","format":false,"excerpt":"The word is out. XE5 will be coming this September, as described in the announcement of a tour of Russia to promote the new release. Translation: Dear developers! Traditionally, in September we are launching a new version of RAD Studio, this year has been for us an exception, as we\u2026","rel":"","context":"In &quot;Delphi&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1554,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1554\/","url_meta":{"origin":1525,"position":1},"title":"Not so Special Upgrade Pricing for XE5","date":"12 Sep 2013","format":false,"excerpt":"XE5 is officially out today, and the online store now has pricing for the new release. Being a scant 6 months since XE4 was released, with a $49 special upgrade price for XE3 Pro customers, I looked to see what special price might be on offer for XE5. $499 is\u2026","rel":"","context":"In &quot;Delphi&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1670,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1670\/","url_meta":{"origin":1525,"position":2},"title":"First Impressions Of XE5 for Android","date":"19 Sep 2013","format":false,"excerpt":"I thought I should at least take a look at the amazing Android support in XE5 so I decided to work through the tutorial that was brought to my attention recently. The first order of business of course, is getting installed. After making a cup of tea, reading a book,\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1601,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1601\/","url_meta":{"origin":1525,"position":3},"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":[]},{"id":653,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/653\/","url_meta":{"origin":1525,"position":4},"title":"RAD Studio &#8220;XE&#8221;","date":"11 Aug 2010","format":false,"excerpt":"News is starting to come out about the upcoming release of Delphi, RAD Studio XE. So what can we expect? Well, based on what has been revealed so far, anyone thinking that the time that has passed since we were supposed to have received 64-bit support has been well spent\u2026","rel":"","context":"In &quot;Delphi&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1365,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1365\/","url_meta":{"origin":1525,"position":5},"title":"XE4 Pricing Revealed","date":"19 Apr 2013","format":false,"excerpt":"Chris Rolliston just posted a link to a video (from Russia) where-in the pricing for XE4 is revealed. All $ amounts mentioned in this article are US $ prices. Your local price may vary depending on how much exchange rate gouging is added on top of the gouging already built\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\/1525"}],"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=1525"}],"version-history":[{"count":12,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/1525\/revisions"}],"predecessor-version":[{"id":1539,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/1525\/revisions\/1539"}],"wp:attachment":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/media?parent=1525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/categories?post=1525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/tags?post=1525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}