Goal

Barring any long delays in the approval process, I believe that I can have an app in the App Store in four months. Interested in joining me on this adventure? There’s a link at the bottom of this post you can use to subscribe and receive updates on WP8 development-related articles.

Motivation

I was recently at Bulk Barn stocking up on some supplies to try recipes from my two newest cookbooks (Primal Cravings and Paleo Comfort Foods). Both contain quite a few recipes with nuts/weird “flours” and since the price of almonds, cashews, etc. varies wildly from store to store, I never know if I’m getting ripped off or if a sale is really a sale. My memory is certainly not improving with age.

But what if I could just pull out my phone and search for “almonds” in my own personal price database? Then I could see that although Costco normally has them for $13.99/kg, this sale at Bulk Barn for $11.99/kg is actually a good deal.

So of course I need to write an app to fix this problem. And of course my mind starts going a million miles an hour on phone/desktop/cloud integration and what a Minimum Viable Product could be and how users could share prices and soon my head is about to explode.

Breathe. Take a step back.

Where to host it? I’ve been pretty happy with Github, but I’m curious to see how ALM will work in a hosted environment (especially building/deploying) so Team Foundation Service (http://tfs.visualstudio.com) it is.

First, let’s make sure our environment is set up properly. Unless you’re very lucky (i.e. already have everything installed), you probably want to set aside 60-90 minutes for this and more if you’re not installing to an SSD.

Hyper-V

Unfortunately, the SDK doesn’t seem to warn you until the end of the installation that it “failed to add current user to Hyper-V administrators group” which could mean several things. The simplest is that Hyper-V isn’t actually enabled yet.

Windows Key > Turn Windows features on or off > Hyper-V > Hyper-V Platform. More details available at http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff626524(v=vs.105).aspx and http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj863509(v=vs.105).aspx

Visual Studio + Windows Phone SDK

VS2013 users may need to modify their installation to enable the Windows Phone development if it wasn’t chosen in the initial install. Windows Key > Programs and Features > Microsoft Visual Studio 2013 > Change > Modify > Windows Phone 8.0 SDK. This requires an additional 5.26GB of disk space.

VS2012 users will need to download/install the Windows Phone SDK 8.0 available at https://dev.windowsphone.com/en-us/downloadsdk.

Either way, this takes a while to install. Even on an SSD it’s ~30 minutes.

NOTE: If you are running VS2012 on Windows 8 or 8.1 x64, do not install the tools from within Visual Studio. you will almost certainly run into this bug which is a massive pain to deal with after-the-fact. When the web installer fails, it has to re-download everything after you apply the fixes. Be sure to unblock the MSI before running (I forgot the first time and got to wait while the installer downloaded all the files for a third time).

(Oct. 23: It appears the fix has been simplified now and there is just a link to an updated installer. The previous workaround involved some manual steps. VS 2013 appears to be ok if you choose “Download from Internet”)

Getting started with Team Foundation Service

After you create an account and a new project (choose Microsoft Visual Studio Scrum 3.0 for process template to keep things simple) you can start jamming all your ideas into the Product Backlog.

The three types of items you will normally deal with are Product Backlog, Task, and Bug. If you really like planning, you can also introduce Features, but avoid getting too caught up in that for now.

imageFrom the main page, click “Open in Visual Studio” to automatically open your repository in VS.

You will (probably) want to “log in” to Visual Studio with the same account you used to create your TFS repo. Otherwise, you can use the normal method of Team > Connect to TFS > Select Team Projects > Servers… > Add … which will get you to “log in” with the same account anyway.

Select your newly-created Team Project (in the DefaultCollection project collection) and click Connect. You will most likely want to configure imageyour workspace mappings before creating the new project. Source Control Explorer should look similar to the picture on the right after all this.

Creating a new project

Finally!

File > New > Project > Windows Phone > Windows Phone App

Be sure to choose the appropriate location to correspond to your workspace mapping from the previous section. Select both “Create directory for solution” and “Add to source control”

Press F5 to run the application. You may get a warning dialog saying “You don’t have permission to run the emulator”.

image

Choose close, logout/restart, and try again. With any luck, you should eventually see the new app running in the emulator.

image

Checking in our code

The last step we should do is save our code to TFS.

Team Explorer > Home > Pending Changes > (Enter a comment) > Check In

We can double-checked this worked by visiting our project on the visualstudio.com site. The Url will look something like {you}.visualstudio.com/DefaultCollection/{ProjectName}/_versionControl

And that’s it for now! Next time we’ll add our very first feature: creating and viewing entries for our pricing database.

Interested in learning more about developing for Windows Phone 8? Enter your information to receive e-mail notifications on relevant articles.