Thursday, December 12, 2013

From concept to reality in 6 weeks - part 18

In two more days it will be one more week gone and that will leave me with only 3 weeks to go. No pressure! After a very long day yesterday, I definitely needed a night to rest and just not think about the Windows Store app. I woke up this morning ready for a new day. It was super frosty outside and I was just glad I did not have to go outside. Definitely zero interesting in running when it is this cold out.

The first thing is to solve the problems I had with one of the layers not displaying the correct colors. I had to go into the code that was defining the values and put in a "System.Diagnostics.Debug.WriteLine" to see what the values were. After seeing the output it was obvious what happened as I had two problems. The first was I saw a bunch of "-Infinity" values. I handled the case with missing values in my data loader but forgot I need to ignore those values when displaying data. The second problem was that all of the values were fractional and yet I stored color values in the range from 1-10. A quick scale factor solved that problem.

Then a couple more fixes and one last test proved that something had gone seriously wrong. I am now getting a run-time exception as the mapping engine does not like something I am passing to it. I try to use the Git client to see what I changed that was not good. I did not find it so it is time to debug until I find the problem.

I had a GoToMeeting with the customer, who was a no show, but I needed to document some of the potential UI needed for the next piece, so I added screenshots of the iPad app into Kanbanery along with some text explaining what I need to do. One of my favorite characters is the checkmark which is needed for the text description of the next few tasks, where I needed to show checkboxes [].

Now I have to hurry up and find this run-time error somewhere in my code. First I need to check on updating the UI from a background thread since I want to make sure that is not my problem. Microsoft has some nice documentation on asynchronous programming that explained many useful things. I don't see anything I am doing wrong so time to dig in a debug until I find and fix the problem. Some times you just have to relax, take a deep breath and then dive in.

I have to say that finding run time exceptions is just nasty in any language. I finally found and fixed the problem as I was calling an asynchronous method and when it returned I had assumed it fully completed - what a terribly bad idea that was. I looked back at the Git source history to see all of the changes I made this morning and then noticed the "async" change. I got into the debugger and checked the values after the method returned and found nothing was setup correctly. Bingo, found that nasty bug and now I get to move onto the making another build to test on another machine that mine.

Since I have only create one successful release build, I had to go remind myself how to do that by reading the documentation. The big secret is to select Store > Create App Packages... and then select "No" that I don't want to put the app in the store. My executable is now 10MB in size and that is after I removed BingMaps which made no difference at all in the size of the executable. Hopefully someone other than me will be able to get that to work correctly in Windows 8.

Turns out that it worked sort of. I was able to load the executable on a USB thumb drive and install it on another Windows 8.1 tablet but the way VSE creates a package installer is a bit odd. You have to be the administrator of the computer in order to use PowerShell. I found a Microsoft article that described the ticket to PowerShell working as you have to set the execution policy as in a PowerShell window:
Set-ExecutionPolicy RemoteSigned
This allows the command to be run to install the executable in the Metro desktop by running:
./Add-AppDevPackage.ps1
Of course most fonts make it very hard to know whether that is a numeric one or lowercase "L" as the last character in the file extension, but that is another usability problem for another day.

Most of the remaining part of the day is trying to get work done in a very crowded Starbucks. I was meeting the mapping engine developers there. Typically they told me it was empty, but when I arrived there was not a single seat available at 2pm. I was constantly getting a dropped WiFi connection, which I assume was due to so many people trying to get WiFi and since I did not use it constantly I was being dropped. I finally gave up and just used the WiFi from my iPhone as it was the only reliable WiFi. Then it started having issues.

It was time to figure out how to get the app working by reading the files I downloaded from the server as that was my intent all along but did not take the time to get that working. For some reason the super crowds in the Starbucks must have caused my brain to stop working as I had to read about File IO again. The quick start guide to reading and writing files in a Windows Store app to the rescue. Everything hinges on a StorageFolder and a StorageFile. Finally after an hour I had the JSON being read from the last files I downloaded that worked. Not bad but it should have been a couple of minutes since I had already dealt with it, but so much time and code had passed thru my mind since then I guess.

The rest of my day was learning all of the new mapping engine APIs that I needed to call and making notes in Kanbanery so I did not forget how to do them when tomorrow morning arrives early. I also had to deploy many times and try to get the app running on a couple of other Windows 8.1 machines to verify the whole deployment would work easily.

No comments: