{"id":1910,"date":"2013-10-16T07:01:28","date_gmt":"2013-10-15T19:01:28","guid":{"rendered":"https:\/\/www.deltics.co.nz\/blog\/?p=1910"},"modified":"2013-10-16T07:01:28","modified_gmt":"2013-10-15T19:01:28","slug":"whats-in-a-number","status":"publish","type":"post","link":"https:\/\/www.deltics.co.nz\/blog\/posts\/1910\/","title":{"rendered":"What&#8217;s In a Number .. ?"},"content":{"rendered":"<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">[Estimated Reading Time: <\/span> <span class=\"rt-time\">4<\/span> <span class=\"rt-label rt-postfix\">minutes]<\/span><\/span><p>Last week I picked up a <a href=\"http:\/\/www.nokia.com\/global\/products\/phone\/lumia520\/\">Nokia 520 Windows Phone<\/a> for what I consider to be an absolute bargain price (<em>well<\/em> under the NZ$299 RRP) specifically as a development handset to allow me to explore the <strong>Windows Phone<\/strong> support offered by <strong>Oxygene<\/strong>.<\/p>\n<p>I&#8217;ve only just started down this road but have already come across a couple of things that might help people who might be scratching their heads (as I was) when getting started.<\/p>\n<p><!--more--><\/p>\n<h2>Devices, Emulators and Senior Moments in the IDE<\/h2>\n<p>After <a href=\"http:\/\/dev.windowsphone.com\/en-us\/downloadsdk\">installing the Windows Phone 8 SDK<\/a>, the first thing I tried was to simply create a project using one of the <strong>Oxygene<\/strong> templates.  This was straight-forward enough.  Choosing <em>New Windows Phone Project<\/em>, a simple <strong>Hello World<\/strong> app sprang into being before my very eyes, complete with XAML UI design and, since the Windows Phone SDK is right at home in Visual Studio, the usual visual form designer for the XAML was also available to me.<\/p>\n<p>But I wasn&#8217;t interested in playing too deeply just yet.<\/p>\n<p>First things first:<em> could I get an app running on an emulator or device<\/em> ?<\/p>\n<p>Sure enough, the <strong>Start<\/strong> toolbar drop down presented a selection of four different emulated devices.  I chose one and off it went.<\/p>\n<p>Well, emulators being what they are, it wasn&#8217;t quite as fast as that might sound (something I had anticipated and just one reason for getting an actual device to develop on).  But it is worth noting that Parallels nested virtualisation <strong>does<\/strong> support Hyper-V to the extent required by the Windows Phone emulator, should you need it.<\/p>\n<p>Encouraged by the ease with which things had gone so far, I connected up my shiny new Nokia phone, but the IDE wouldn&#8217;t recognise it as a valid device for deployment\/debugging.<\/p>\n<p>It turns out you have to <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windowsphone\/develop\/ff769508(v=vs.105).aspx\">register a device for development<\/a>, which unlocks it and makes it available as a development device.<\/p>\n<p>No problem.  There is a tool in the Windows Phone SDK specifically for registering the device which also unlocks it.<\/p>\n<p>But something else was not quite right: <em>The emulator devices that were previously listed had also disappeared.<\/em><\/p>\n<p>It appears that this is a known (though as far as I could determine not understood\/explained) problem that sometimes occurs with Visual Studio and is not a problem specific to Oxygene (which I can verify since the exact same problem was very much evident in the <strong>Visual Studio Express for Windows Phone<\/strong> edition that I also had installed in this particular VM).<\/p>\n<p>Attempts to <strong>Repair<\/strong> my emulator devices using the <strong>Windows Phone 8 SDK installer<\/strong> were fruitless.<\/p>\n<p><strong>Warning:<\/strong> <em>the &#8220;Finalizing tools step&#8221; in this process had to be left running overnight on my machine, having taken well over an hour at the point at which I decided to give up waiting and see if things had finished in the morning.  Fortunately they had, but still I had no emulators and my device still wasn&#8217;t being recognised.<\/em><\/p>\n<p>Some additional digging then turned up what proved to be the answer:<\/p>\n<p>Delete the contents of the <code>%LocalAppData%\\Microsoft\\Phone Tools\\CoreCon<\/code> folder.<\/p>\n<p>Problem solved!<\/p>\n<p>Upon restarting the Oxygene Visual Studio shell, the emulators re-appeared in my <strong>Start<\/strong> options and my device was now listed by name rather than just as a generic &#8220;Device&#8221;.<\/p>\n<p>And sure enough, I could now run the app on my device.  <strong>Hurrah !<\/strong>  \ud83d\ude42<\/p>\n<p>Which left just one question.<\/p>\n<h2>My God&#8230; It&#8217;s Full of Numbers&#8230;<\/h2>\n<p>In the visual designer I could see that the <strong>Hello World<\/strong> app UI consisted of a page title and sub-title:<\/p>\n<figure id=\"attachment_1912\" aria-describedby=\"caption-attachment-1912\" style=\"width: 327px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Screen-Shot-2013-10-15-at-14.38.41.png?ssl=1\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Screen-Shot-2013-10-15-at-14.38.41.png?resize=327%2C500&#038;ssl=1\" alt=\"Very Plain UI\" width=\"327\" height=\"500\" class=\"size-full wp-image-1912\" srcset=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Screen-Shot-2013-10-15-at-14.38.41.png?w=327&amp;ssl=1 327w, https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Screen-Shot-2013-10-15-at-14.38.41.png?resize=196%2C300&amp;ssl=1 196w\" sizes=\"(max-width: 327px) 100vw, 327px\" data-recalc-dims=\"1\" \/><\/a><figcaption id=\"caption-attachment-1912\" class=\"wp-caption-text\">Very Plain UI<\/figcaption><\/figure>\n<p>Yet when running in the emulator, or on the device, there were some additional numbers running down the right-hand side of the display.<\/p>\n<figure id=\"attachment_1913\" aria-describedby=\"caption-attachment-1913\" style=\"width: 343px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Screen-Shot-2013-10-15-at-14.38.54.png?ssl=1\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Screen-Shot-2013-10-15-at-14.38.54.png?resize=343%2C551&#038;ssl=1\" alt=\"Puzzling Numbers\" width=\"343\" height=\"551\" class=\"size-full wp-image-1913\" srcset=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Screen-Shot-2013-10-15-at-14.38.54.png?w=343&amp;ssl=1 343w, https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Screen-Shot-2013-10-15-at-14.38.54.png?resize=186%2C300&amp;ssl=1 186w\" sizes=\"(max-width: 343px) 100vw, 343px\" data-recalc-dims=\"1\" \/><\/a><figcaption id=\"caption-attachment-1913\" class=\"wp-caption-text\">Puzzling Numbers<\/figcaption><\/figure>\n<p>I had noticed them in the emulator but had thought they were some emulator diagnostic, so when they showed up on the device as well, I was a bit puzzled.<\/p>\n<p>But it turns out that <a href=\"http:\/\/www.jeff.wilcox.name\/2010\/07\/counters\/\">these are indeed performance diagnostics, enabled by default in debug builds<\/a>.<\/p>\n<h2>Enforced Hiatus and Windows Phone Surprise<\/h2>\n<p>Unfortunately my fun with Oxygene is on temporary hold.<\/p>\n<p>My iMac is currently &#8220;in the shop&#8221; having a <a href=\"http:\/\/support.apple.com\/kb\/TS5167\">potential fault with the graphics card investigated<\/a>.  All being well it will be only a few days &#8211; 4 at most.  I hope to use the time to get started on designing an app I have in mind for Android, iOS and Windows (Phone and Surface RT).<\/p>\n<p>I should also say that I have been pleasantly surprised by my little Windows Phone.  Actually, it&#8217;s not so little, with a 4&#8243; screen which is far from best in class but equally far from the worst either.  It&#8217;s not only a very capable bit of hardware but Windows Phone itself has been surprisingly enjoyable to fiddle with.<\/p>\n<p>On the software side, <a href=\"http:\/\/www.windowsphone.com\/en-us\/store\/app\/nokia-cinemagraph\/594477c0-e991-4ed4-8be4-466055670e69\">Nokia CinemaGraph<\/a> is a fun little twist on image capture and the free <a href=\"http:\/\/here.com\/download\">HERE suite<\/a> of apps (turn-by-turn navigation, maps and Layar-like City Lens) more than give commercial navigation apps a run for their money.<\/p>\n<p>I&#8217;m looking forward to being able to create apps for this little fella with Oxygene.<\/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\">4<\/span> <span class=\"rt-label rt-postfix\">minutes]<\/span><\/span> Last week I picked up a Nokia 520 Windows Phone for what I consider to be an absolute bargain price (well under the NZ$299 RRP) specifically as a development handset to allow me to explore the Windows Phone support offered by Oxygene. I&#8217;ve only just started down this road but have already come across 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,242,180],"tags":[181,209],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1TKYv-uO","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1562,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1562\/","url_meta":{"origin":1910,"position":0},"title":"A Shaggy Dog Goes for a Breath of Fresh Air","date":"12 Sep 2013","format":false,"excerpt":"It has been a frustrating week for me in some regards. It all started with the news of Microsoft acquiring Nokia. At first I paid it no real attention. I have never had a Windows Phone and my few experiences of Windows on any sort of mobile or handheld device\u2026","rel":"","context":"In &quot;Delphi&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pc-museum.com\/gallery\/rcm-047-big.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2296,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/2296\/","url_meta":{"origin":1910,"position":1},"title":"Sign Here Please&#8230; (Using This Specific Pen)","date":"01 Sep 2014","format":false,"excerpt":"My original Android version of TXT-2-PARK has been in the Google Play Store for a little over a week now. But it was only on Saturday that I decided to install the release version onto my phone from the store itself, and found a problem. The application would download just\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1713,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1713\/","url_meta":{"origin":1910,"position":2},"title":"How to Call Java Code from an Oxygene Android Application","date":"20 Sep 2013","format":false,"excerpt":"Lachlan just posted a link to a post on Google+ (also available as a PDF) demonstrating how to call Java from Delphi XE5. I was shocked at both the amount and the nature of the code involved. It is long, convoluted and ugly stuff (nb. that isn't a criticism of\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1619,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1619\/","url_meta":{"origin":1910,"position":3},"title":"iOS 7 and arm64 Support in Oxygene","date":"16 Sep 2013","format":false,"excerpt":"Marc Hoffman of RemObjects blogged over the weekend about the forthcoming iOS 7 and arm64 support in Oxygene. Actually, the only part that is really \"coming\" is the arm64 aspect since, as he explains in the blog post, Oxygene has always been able to use the iOS 7 SDK betas\u2026","rel":"","context":"In &quot;Delphi&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2285,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/2285\/","url_meta":{"origin":1910,"position":4},"title":"While I Was Waiting For Apple&#8230;","date":"01 Sep 2014","format":false,"excerpt":"So Saturday morning I finished the iOS version of my application and published it to the App Store. Of all of the app stores, the approval process with Apple evidently takes the longest. So, whilst waiting for my app to be released, I developed (and published) the Windows Phone version\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1817,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1817\/","url_meta":{"origin":1910,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/1910"}],"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=1910"}],"version-history":[{"count":7,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/1910\/revisions"}],"predecessor-version":[{"id":1924,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/1910\/revisions\/1924"}],"wp:attachment":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/media?parent=1910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/categories?post=1910"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/tags?post=1910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}