WordRoom – vägen till cross platform med Xamarin och Azure

Att bygga ett onlinespel innebär många utmaningar, att bygga ett onlinespel cross platform innebär ännu fler utmaningar. Under TechDays kommer jag och Johan Karlsson att berätta om våra erfarenheter efter att vi byggde ordspelet WordRoom där vi använde Xamarin dels för att kunna använda C#, men främst för att kunna dela klientkod mellan alla plattformarna för att spara utvecklingstid och öka förvaltningsbarheten. Som backend använder vi en lösning hostad i Windows Azure, en lösning som är fullt skalbar för att kunna skalas både upp och ner beroende på hur belastningen ser ut.

Under vår session på TechDays kommer vi att fokusera på dessa områden

  • Hur man bygger en cross platform lösning för mobila enheter med hjälp av Xamarin
    Vi kommer att berätta varför vi valde Xamarin och vilken arkitektur vi använder för WordRoom för att kunna dela så mycket kod som möjligt mellan de olika plattformarna, vilken kod man kan dela och vilken kod som måste vara plattformsspecifik.
  • Vad man behöver tänka på för att bygga en skalbar backend med hjälp av Azure
    WordRoom använder flera olika tjänster i Azure. Vi kommer att berätta vilka vi använder och hur vi tänkte när vi byggde en arkitektur anpassad för att kunna utnyttja Azure optimalt.

 

WordRoom finns att ladda mer för Windows 8+, Windows Phone, iOS och Android.

TechDays 2014

Den 19-20 november (17-20 november med pre-conf inkluderat) anordnas utvecklarkonferensen TechDays av Microsoft. Jag och min Sogeti- och IO2GameLabs kollega Johan Karlsson har fått äran att vara med på den. Vi kommer att prata om det vi brinner mest för nämligen cross platform utveckling för mobila enheter.

På pre-conf (den 17 november) kommer vi tillsammans med Peter Bryntesson (Microsoft), Johan Lindfors (Coderox) och Anderas Hammar (Jayway) att hålla en heldag om hur man bygger appar för Windows (Windows Store och Windows Phone) och för iOS och Android med Xamarin. Läs mer här.

Under själva huvudkonferensen kommer jag och Johan att ägna ca en timme till att berätta hur vi har arbetat med vårt spel WordRoom för att göra det cross platform med Xamarin och Microsoft Azure. Läs mer här.

Tycker ni att detta låter intressant tycker jag ni ska komma till TechDays på Kistamässan, självklart kommer det bjudas på massa andra intressanta föreläsningar också. Se hela programmet här.

Presentation av WordRoom

Dataföreningen anordnar ett seminarium den 28:e maj kl. 17:00 där jag och Johan kommer att prata om hur vi har byggt WordRoom och om våra erfarenheter av marknadsföring av appar. Vi hoppas att ni vill komma och lyssna på oss och diskutera spel- och apputveckling med oss!

Seminariet kommer att hållas i Sogetis lokaler i Borlänge och alla är välkomna!

Läs mer och anmäla dig, http://natverk.dfs.se/kretsar/dalarna/WordRoom_Sogeti

Beyond the Tiles

Monday was me, Johan (@johankson) and David(@d_andersson) visiting Microsoft for a seminar about design, primary for Windows 8 and Windows Phone. Arturo Toledo (@arturot), Alex Toledo (@toledoal) and Vincent Garcia (@vincentgarcia) was the speakers at the seminar. Arturo is a former member of Microsofts Windows Phone team but now he has his own company, Toledo2, together with his brother Alex. The third speaker Vincent Garcia are working with design for Windows 8 and Windows Phone at Avanade Digital.

The Toledo brothers start the day by giving us a lesson in design history and talked about the Swiss design school and the international style. It’s there the Metro design or Microsoft design language as it’s called today, has its roots.

One of the message of the day that Microsoft design language is much more than tiles, thereof “Beyond the Tiles”. They say the developers of Windows apps follow the guidelines to much and that make all Windows apps look the same, many developers use the Visual Studio templates and thinks the design has to be in that way.

Vincet Garcia showed us a couple of designs he had done for Windows 8 and Windows Phone and how the design has evolve with their increased understanding of the design language.

We also get som tip how we could improve the design of the Windows 8 version of WordRoom, thanks for that!

It was a good day and I became inspired and get much new knowledge to use in coming designs.

 

Browser mode in Internet Explorer

We building a web version of WordRoom, today when I tested the game on Surface RT it doesn’t look like expected. I tested in desktop and I had same issue there as I had in the Windows store app of Internet Explorer. But in desktop mode I could use Internet Explorer developer tools. It shows that Internet Explorer was in IE7-mode. Because we use a lot of HTML5 features, we want to run it in IE10-mode from start.

I searched the web for solution and I found a meta tag that fixed my issue.

<meta http-equiv="x-ua-compatible" content="IE=10" />

If you want to read more about this, read this page, http://msdn.microsoft.com/en-us/library/jj676915%28v=vs.85%29.aspx

Authentication with Azure Mobile Services

When developed the multiplayer part of WordRoom we discussed to use different authentication providers. But it was a lot of code to integrate each provider. And we wanted more than one. Instead we developed our own solution.

But just ask yourself, do you want to create an account everywhere with different username and passwords. I don’t. When we discovered Azure Mobile Services it was an obvious choice. Mobile Service gives you authentication with Microsoft-, Google-, Facebook and Twitter account and it’s for free. You only need to connect it to a database server. But we already had a database server in Azure. So i next version of WordRoom, you can authenticate with your Microsoft-, Google-, Facebook- or Twitter account.

With just a few rows of code you can authenticate the user with one of the authentication providers.
That Mobile Service is for five different platforms is a huge strength. You can use it for Windows Store applications, Windows Phone, Android, iOS and HTML5/JavaScript. If you use Xamarin Studio for developing your Android and iOS apps, there is a third part library.

In a Windows Store application you just add the SDK, some rows in App.xaml.cs and one row where you want to authenticate the user.

user = await App.MobileService
                .LoginAsync(MobileServiceAuthenticationProvider.Facebook);

Read more about Mobile Services

 

Poco2Js

We have started to develop a web version of WordRoom. We will use web socket to communicate with our backend. All messages (POCOs) that is used in our versions of WordRoom is written in C#. We don’t want to rewrite all messages to JavaScript for use with web sockets. To solve this problem we created a tool called “Poco2Js”, it is available at CodePlex, https://poco2js.codeplex.com/. What it does is that it convert .NET POCOs to JavaScript classes. You just choose an assembly and all types in the assembly will be converted to JavaScript classes.

 

WordRoom in spotlight at Windows store

Our game WordRoom has been choosen to be in spotlight at Windows Store in Sweden for the fourth time! No when more people using Windows 8 than last we was in spotlight we hopefully can get more players. It’s fun that Microsoft like our game. We are also on of ten apps that Microsoft Sweden have choosen for their website, http://windows.microsoft.com/sv-SE/windows-8/apps?ocid=GA8_O_WOL_Hero_Home_Apps_Null

WordRoom in spotlight at Windows 8 store

WordRoom in spotlight at Windows 8 store

 

 

 

 

Developing apps with mono

WordRoom started as a Windows Phone project, the third client we started to develop and the first one we released was for Windows 8. We developed the windows 8 relative fast because we could reuse a lot of the code from the Windows Phone project in that we used portal library for the core logic.

As I mentioned above, Windows 8 was the third client we started to develop. The second was for android devices. I started to build the android client with java and eclipse. Step one was to translate all core logic from C# to java, a lot of work but I developed an almost finished client for WordRoom. But in the end of 2012 when we should start to develop the client for iOS we decided to use and mono touch and mono for android from Xamarin so that we could use the same assemblies for the core logic that we did when developing for the Windows platforms. We also share data contract assemblies between the backend and the clients. So now we running the same code in at backend in Windows Azure, on Windows 8, Windows Phone, Android and iOS.

The decision to start using mono is one of the best decision we have taken. We saving a lot of time and we get an app that is much easier to maintain.

Next app I will develop I will think about that that the code will be shared between different platforms earlier in the process. Because if you have a structure in your project with GUI and business/game logic split up and using interfaces for platform specific features, for example local storage you can reuse much more code and save a lot of time.