Tuesday, November 19, 2013

From concept to reality in 6 weeks - part 3

Last night I went by BestBuy to buy an HDMI cable so I can test my apps on the 1080p TV at work to simulate the actual device that the app will have to run on that I am building. Those cables are common and come in all lengths and quality of connectors. I choose the 8 foot rocket fish brand since it was the cheapest. I also asked if there was any non-Apple computer sold at BestBuy that could drive a Cinema or Thunderbolt display. The response was shocking to me Apple tuned ears. The sales person took me over to the Windows Surface 2 and showed me the mini display port. This morning I had to look that up to see how Microsoft marketed it in the on-line brochure.

That was a side note as today's task is to get a Windows 8 app built. This totally acceptable since it is early in the project and this change of direction is to be expected and embraced. Now if that happens a couple of weeks before the product release then I will not be nearly as happy. It is good news for me since I looked at the Visual Studio Express device menu and the choices are very limited. I see 4 different devices in the emulator none of which are close to 1080p. The choices are "WVGA 512MB", "WVGA", "WXGA", and "720p". I am happy to move to building native Windows 8 apps, so I must find some example code for maps as my first working code in VSE for today.

Since I already have VSE installed and working, I just need a different SDK loaded on my laptop. I also found another useful page on the MSDN portal. In my initial exploration, I seem to always find two pages that describe the same thing in two different ways on Microsoft web sites. In this case, the later page had the link to the latest Windows 8 SDK dated 17 October, 2013. As before the initial download was very small and the actual SDK is 1.6 GB in size, so I quickly connected an ethernet cable in hopes it would make this go a bit faster.

Then I find out that they are many Visual Studio Express products. Thank you Microsoft for helping me easily develop the same product on multiple platforms. I must now download Visual Studio Express for Windows as I have Visual Studio Express for Windows Phone working on my laptop. This is definitely not what I expected. When I click on the correct download link, somehow the form filled in my email address and nothing else. I have to retype my "Full name", select my "Country/Region". I just entered this stuff two days ago and already it has forgotten me. Maybe if I paid for the Ultimate version then it would remember me! Wait they have a 90 day free trial for all of their products and I cannot find the cost anywhere on the web site. I am supposed to be done in 6 weeks so I could actually use any of them, if only I could figure out what is different from Visual Studio Ultimate, Premium, Professional or Test Professional. Only Visual Studio Express has the distinction of a Web, Windows, and Windows Desktop versions so maybe they would help me one day. I did learn that Microsoft also has a special program called BizSpark which is for startups to get 3 years free software and support. As I open the accordions on the Visual Studio page as quickly see from the first paragraph what each offers and the Professional version allows me to create all different apps in a single IDE. I am going to keep going with Express for now until I see a need to get a more complex product as I am sure the Professional version will have all kinds of things I don't need and will not use.

When I download the VDE for Windows, this time I went out on a limb and signed up for a personal account (https://attentive2design.visualstudio.com). As the download was working, a form popped up on my screen asking for a project name, description and let me connect to either "Team Foundation Version Control" or "Git". Wow, that is a really hard choice. I can use Git and the GitHub client I installed on the laptop of figure yet another Microsoft tool for version control, that probably easily integrates into Visual Studio. So Git it is. Then I get another important choice for a "Process template", none of which are really appealing to me: "Microsoft Visual Studio Scrum 2013", "MSF for Agile Software Development 2013", or "MSF for CMMI Process Improvement 2013". I can definitely say the last one is scary but maybe because I have no clue what it means. I could look it up but I have zero interest in knowing. I have done scrum before but not I do Agile so I will pick that just for fun. Now I see what it is doing. It is creating a Visual Studio Online account where I can share task progress with other people - it is another Kanban board with management tools. I am going to skip that and leave that for another day for now.

Wait, the VSE download finished so I have to launch it and then answer a bunch of questions. Today is my lucky day as I get to into my Microsoft account and password twice in two sequential screens. I thought I was logging in once and then up pops a second login screen to get my developer license. The good news is that it showed me my developer license will expire on 18 December, 2013. Probably the day I am trying to get serious work done and that will be the day I switch to using Professional.

Now I need to find some Windows 8 example code include some maps. Now things have really changed as native Windows 8.1 apps use Bing Maps instead of the phone apps that use Nokia HERE.com maps. I guess I now get to switch to Bing Maps, well that is a bad description as I hardly knew anything about the Nokia maps except what I read in my downtime when software was loading on my laptop. Using the Bing Maps API is only temporary until I get the working Windows version from our mapping partner. After the download and installer completed, a message popped that I had to restart VSE. I then noticed that the different versions of VSE have the same icon but different colors. The VSE for Phone is read and the VSE for Windows 8 is blue. While relaunching I read the Bing Maps download page and it order to use it I have to get a license key. Again I can get a 90 free trial, which is more than enough for what I need. If I am still using Bing Maps in 90 days then I will probably be fired as it will be a complete failure on my part. When reading the license page, I see I only get 10,000 billable transactions, so I have to go read about that. After all of that I want to see if I can use Nokia HERE.com maps for Windows 8.1 apps. I went ahead and signed up for a Nokia developer account and then logged into that account. When I clicked on the link within the developer portal to get an evaluation key, then I was had to click on a link in an email to activate my account. Once I signed in then I had to go back to the main developer site as I was stuck on a page with no menus at all - that clearly is not the way to win partners. On the first screen I see I am now hosed as the choices under "Application platform" do not include Windows, but only Windows Phone. Plus the "Solution" choices don't match I need to do either. OK, time to go back to Bing maps...

Once I logged into my Microsoft account, and answered several questions in many forms I was logged into the Bing Maps Account Center. From past experience I knew I need a map key, so I clicked on "Create of view keys". In the text above the form I see a curious link labeled "TOU", and when I click on it then I see just about the worse fine print text you can imagine where I have to read a terms of use document to understand what is going on - for the sack of time I give up as that is the smart thing to do. I am definitely confused now as I see a text box labeled "Application URL". Am I supposed to make that up? I am just happy I now have a key so I should be able to create a simple Windows 8 app with a Bing map. I had to quickly read a bit more before getting started on how to use the Bing maps first. I have an example to work thru to make sure the Bing maps are setup correctly and working as expected. My first major road block of the day - I installed "Bing Maps SDK for Windows 8.1 Store apps", then restarted VSE for Windows and do not see the Bing Maps reference to add it to my VSE project. Bummer. I am going to try a different tactic by downloading all of the Bing Map samples. The download was easy and then I extracted all of the files and when I tried to open one of the project files, then bad error messages started appearing as these examples were built for VSE for Windows 8 and not 8.1. I tried to following the directions to retarget the solution but that did not work. I tried to build the app and nothing I tried helped as VSE kept fussing about the missing Bing reference. It looked like the name was incorrect as it was referring to an older version of Bing Maps. I deleted the reference from the project along with the missing Visual Studio C++ Runtime package. I then had to look up how to add a reference to my project and followed the directions by right clicking on "References" in the "Solution Explorer" and clicking on "Add Reference...". On the left hand side, I opened "Windows" and selected "Extensions" and clicked on "Bing Maps..." entry but that did nothing. Then I went back in and realized the first column was a checkbox that I had to select. Then clicking on OK actually did something and automatically added the matching C++ Runtime library. My project built and when I tried to run it, I got a bunch of Watch windows up and when I closed all of them, I saw the message in the status bar saying "This item does not support previewing". Now I have to figure out how to run a Windows 8.1 app as it just did not work like I wanted it to - apparently wishful thinking does not help when working with VSE.

Just when I get going I have to read some articles and when I go back to my laptop is has become very dim and nothing I do changes the brightness. At first I went Settings and the brightness is already set to 100%. I then have to figure out where the automatic brightness is being set. I search for "display settings" hoping that will be my ticket to brighter days. It was not under "Display" in the "PC and devices" screen that appeared. I thought of where I might find this on my Mac and I immediately went to "Power and sleep" and it was the first item under "Brightness" named "Adjust my screen brightness automatically". Problem solved.

Back to my map issues. I accidentally tried to repair my VSE and so I am waiting yet again for the VSE install process to complete. I realized Windows 8 is new but somethings just never change - waiting for installers and reboots is a way of life on Windows not matter how new it looks like on the surface - pun intended. Now I am beginning to think I need Visual Studio Professional just when my computer started rebooting. I read up on IE 11 and they found just about the most geeky name for what every other browser called the Web Inspector - Microsoft picked the name of F12 Tools. Another unfortunate thing happens every time my laptop is rebooted is that the HDMI display does not work. I have to go into the menu and automatically detect the display. Now I have my map display correctly on my laptop. I thought I could just drag my VSE to the 1080p TV and then restart the app and it would display on that device. Again, I am just taking too much for granted. Now I have to figure out how to run the app on the TV. I found the article and it I learned I have to use Windows logo key + Shift + Right Arrow to move the app to another monitor. The good news is that I have a Bing Map displayed on the 1080p TV and it looks pretty good. I zoomed into a traffic problem in Carrollton, WI and turned on the Aerial view and the stop light turned on. The road problem is dashed red and white lines on the road so they jump out when zooming around on the map. Then I had to look up how to stop an app, as it is easy to disconnect the app from the VSE debugger or to stop debugging, but closing a full screen app with no windows controls gets interesting. So interesting in fact that Microsoft wrote an article on how to do it - you drag the app to the bottom of the screen!

A little about Bing Maps - the first example I tried was the Pixel to Location Sample, which each tap and hold results in a point being added to the map. It just was not intuitive to tap and hold as that is not an obvious behavior for me. Now I must be in a roll as I have 4 Bing Map examples running. Each one has the same problem of being an older version of VSE so each must be re-targeted, then I have to delete the 2 missing libraries and then add Bing Map back in. In all cases I have to use my Bing Maps key by editing the MainPage.xaml file where the text "INSERT_YOUR_BING_MAP_KEY" text appears and the apps just work. The only real exception is the "GPX Route Viewer Sample" as that one is really special. It is under version control and not the Git kind so I have to respond to 3 dialogs fussing that I don't have that plugin in VSE. Once I get past the warnings that my changes will not be under source control and that I need to extra careful and I cannot connect to the Microsoft version control system, then I am fine. Maybe it is a marketing ploy to get me to use it - sorry that is just not going to work. The reason why I picked this example is that I found sites that have large GPX routes that I can download. The first one I tried is a long distance walk across the southern part of England. The second gem I found was a site that has data for each state so I naturally went to the NC section. I picked 3 of them, 309 airports, 8961 churches, and mother of them all of 12,875 water features. I tried downloading them locally on my laptop and also use Microsoft's SkyDrive, but I could not get them to show up every time in the Windows 8 file chooser for the Bing Map app sample. I was able to get the England walking path to load and to animate so that is pretty fine for today. It turns out that the SkyDrive thing is not as simple as I thought. On my laptop all I have to do it know where to go instead of using the web site since the files got saved as XML instead of the required GPX file extension when I used my Mac to upload the files. it turns out that location is C:\Users\Rick\SkyDrive, so I just downloaded the files on my laptop and then moved them into that folder and it then worked. Then I realized it was there all of the time in the Windows Explorer left side bar! Besides my SkyDrive problems, the NC files crash the Windows 8 app so there is something in there that is does not like. I then found the final gem of the day as a site that has GPX files for Nepal Himalayas treks.


No comments: