incomplete = testCoverage < complete

My Xamarin Project

2016-04-11

So I am ready to start creating my app with Xamarin and Visual Studio, what am I going to create?

My partner Faustina is Romanian. She speaks perfectly good English and we have no problem communicating, but out of respect I feel compelled to learn her language. Now Romanian is a Romance language, which means “things” have gender. Being an Englishman I struggle with this concept and I just about got my head around it when I learned French but Romanian adds the concept of Neutral Gender, where the singular thing is masculine while the plural is feminine. Now most Romanians are kind enough not to laugh when I get this wrong but I want to get it right. I learn well from repetition, so what I want is an app that presents me with flash cards containing a noun and asks me to choose the gender. That would do for starters but I would really like it to be adaptive and test me more frequently on the ones I get wrong. For good measure I would like it to give me some stats.

I have an iPhone and iPad and and looked in the store for such an app and didn’t find anything. There are other apps designed to help me learn Romanian (as well as other languages) but none that focus on this specifi issue of mine. So I am going to create one, and while I am there I am going to create it to support other Romance languages too.

Here is my list of acceptance criteria for v1:

So what am I going to call it? Nounder was the first thing I thought of, a simple mashup of noun and gender, and it stuck so I am going to go ahead and create a Visual Studio solution for Nounder.

I keep all my private source code in Git repositories in Visual Studio Team Services so I started by creating a new Team Project for Nounder and cloned the empty repo to my local disk where I will put everything. Here are the steps I took to get my solution setup. I will talk about decisions I made after these.

  1. I asked Visual Studio to create a New Project
  2. In the New Project dialog I located and selected the C#\Cross Platform branch of the Templates tree
  3. I selected Blank App (Xamarin.Forms Portable) as the project type
  4. I entered Nounder as the Name of the project
  5. I entered the path to my project repo
  6. I cleared the checkbox labelled Create directory for solution
  7. I clicked on OK

Here is what the dialog looked like before I committed it
New project settings

Here is what Solution Explorer looked like once the project was created and I collapsed the tree
Solution Explorer after project created

So why did I choose the Xamarin.Forms Portable project type? Well when I first looked into Xamarin I looked at doing it the vanilla way, which meant I still had to know how to create views for each platform. While this wasn’t a great hardship it was quite a bit of work to support all platforms. Then I discovered Xamarin Forms and saw how it abstracted the difference in views away, I liked that idea as it got me much closer to the idea of 100% shared code. When I delved deeper I found the Xamarin Forms development model was very close to that of Silverlight/WPF, which I have a lot of experience with. Even better it supports binding and MVVM, which makes for much more testable code. I am sold and until I find something I can’t get done with Xamarin Forms I am going that route.

Why Portable instead of Shared? A Shared project doesn’t get compiled to an assembly, instead the the code files get linked into each platform specific project. If you are a fan of conditional compilation and want to go this route for handling different implementations per platform then you have the choice. I rarely use conditional compilation, instead I prefer to work to interfaces and provide different implementations of the interface for each platform so until I find I can’t get away with this I choose to go the Portable route and create other platform specific library projects to handle differences. I will be using IoC within the project anyway so hopefully I will be able to utilise this to inject different implementations.


Blog comments powered by Disqus