MVP Client Development

Last week, I had the honor and privilege to be elected as a MVP Client Development.This award goes to people that have contributed to the community for the last twelve months in diverse ways. It is awarded every three months.

The Microsoft definition is:

The Microsoft Most Valuable Professional (MVP) Award is our way of saying thank you to exceptional, independent community leaders who share their passion, technical expertise, and real-world knowledge of Microsoft products with others. It is part of Microsoft’s commitment to supporting and enriching technical communities. Even before the rises of the Internet and social media, people have come together to willingly offer their ideas and best practices in technical communities.

My definition is shorter:

Love what you do, share what you know and make new friends.

I would like to thank all my developer friends and Microsoft employees who nominated me.

MVP

How to be eligible to receive MSDN Ultimate, Office and Azure for FREE

The title seems a bit unreal, but it is totally true and legit. Please read on.

Last year, I attended the International Startup Festival in Montreal. I met the Canadian Microsoft team who promote the Microsoft program BizSpark. You can get a quick summary of BizSpark at Woot Studio.

As a Windows Phone or Windows 8 developer you will be interested in:

  • 1-year of a Windows Phone Store developer account.
  • 1-year of a Windows Store developer account.
  • MSDN Ultimate which includes Visual Studio Ultimate, Windows 8, and Office.
  • $150 per month of Windows Azure.

Before I met the Microsoft evangelists, I thought that BizSpark was only for registered/incorporated businesses. I was wrong.

The requirements to be eligible for BizSpark are:

  • You are making less than one million in revenue per year. If this is not the case, you don’t need BizSpark!
  • Your startup or business has less than 10 employees.
  • Your business should be less than 5 years old.

The last requirement is that you need to develop software. Be careful; you need to develop your own software. In other words, you need to sell a product. A company that develops software for clients is not eligible for BizSpark.

What if you already have Windows Phone apps or Windows Store apps published? You are probably entitled to get BizSpark.

The last requirement is that you need a professional-ish website with a non-personal email. The best example of a professional-ish website is the website that you are reading! If you don’t have a website, I encourage you to create one. It is a bit of work, but it is highly worth it. I can’t guarantee that you’ll be 100% eligible to get BizSpark following my steps, but it has worked for two of my friends and me. It takes less than two days to find out if you are eligible.

Microsoft does not seem to check if you have a registered business.

This week, I’m “celebrating” my first year of BizSpark. This great program lasts for three years. When the program ends, you keep all the software that you have installed.

Thanks to the fact that Windows Azure is free with BizSpark, I could try Azure without worrying about the cost. In one month, I learned how easy it was to play with Azure Mobile Services, Azure SQL, Blob Storage, Virtual Machines and Azure Mobile Services. I hadn’t played with backend before and I was able to release my Windows Phone application App Spotlights that uses all the above-mentioned technology.

Conclusion

If you are an Indie developer selling software, try subscribing to BizSpark.

App Spotlights for Windows Phone

I’m pleased to announce the availability of App Spotlights.

As a Windows Phone developer, I can tell you that one of the best gifts a developer can receive is when one of his apps is in the spotlight. First, it’s an honor from Microsoft to be selected and secondly, it has a huge impact on downloads. Currently, there is no easy way to know if an app is featured, as there are 121 markets. The main feature of this app is to notify the developers with a live tile notification and a toast when an app is in the spotlight.

clip_image001

App Spotlights is a perfect companion for Windows Phone app buyers and an indispensable tool for developers.

Windows Phone Buyers:
★ Access to more than 2400 spotlighted apps from all 121 markets every day.
★ Have more confidence when buying a spotlighted app.
★ Consult three charts to find out the most spotlighted apps in the marketplace.
★ Navigate faster than the built-in Store app when looking for spotlighted apps.

Windows Phone Developers:
★ Get notified when your apps are in the spotlights in any markets. Share the news with potential buyers on your favourite social networks.
★ Obtain a detailed history when your apps were in the spotlight in each market.
★ Analyze the impact on your downloads when your apps are in the spotlight.
★ Track the visibility of your competitors.

Other features:
★ Toast and Live Tile notifications.
★ Lock screen information from App Spotlights can be used.
★ Fast loading and resume.

Note: Spotlight statistics have been calculated since February 17th 2013.

Screenshot 4Screenshot 7

Promotion until April 17th: 33% off

WindowsPhone_208x67_blu

QR

My Surface Pro Review: A Developer’s Perspective

Before I start this review, I would like to thank my employer, Mirego, for offering me a trade-in of my Surface RT for a Surface Pro! As a technology lover, it was impossible to say no.

This week, I called a couple of Future Shops (I live in Montreal, Canada), Best Buys and Staples. After multiple calls to Staples, I was never able to talk with a human, they are apparently too busy. Future Shop (sister company of Best Buy) answered me, but said that they didn’t have any info concerning the Saturday availability. However, there was a nice lady on Wednesday who took my name over the phone at Best Buy Marché Central to let me know the minute they were going to receive the Surface Pro. I didn’t hold my breath. However, Friday night at 8:50, she called to give me the news that the truck didn’t have any Surface Pros. I was kind of disappointed sine earlier in the week, Best Buy announced that all the Canadian stores would have some. She told me that Best Buy at Anjou would have some. I wasn’t about to start holding my breath…

Saturday morning, I made sure to arrive 30 minutes before the store opening. I was not sure if I would have face a line up or not. Luckily, the line up 10 minutes before the opening looked like this:

WP_20130209_001

The security guard saw me taking a picture and asked me why I was taking a picture and why I was so early. It’s the Surface Pro launch my friend!

9:00 arrived and I went straight to the computer section. I was so happy when I saw this display:

WP_20130209_002

The salesman was friendly enough and we chatted for a while. The employees were looking forward to the Surface Pro.

At the Microsoft BUILD conference, I received the touch keyboard with my Surface RT, but I was not a huge fan of the keyboard. This time, I selected the type keyboard. One thousand three hundred and one dollars (with taxes) later, I was out with the 128 GB version:

WP_20130209_003

When I first turned on the Surface Pro and saw the Start menu, my reaction was that it has an amazing screen. It is sharp and crisp (thanks to the HD resolution). I launched a whole bunch of apps to see how fast and fluid the Surface Pro is. To give you a better idea, here is a video that my friend Matthieu took:

Load time fight between a Surface Pro and a Surface RT

Convinced? I am.

My second test was the type keyboard. Short review: it is night and day compared to the touch keyboard. I love it. It feels like a regular keyboard. I highly suggest the type keyboard, especially for developers.

The hidden gem of the Surface Pro is the Pen. I launched the OneNote app and I tried it. It works without lag and the eraser works well too. It will definitively be a great tool for taking notes.

Why the Surface Pro over a plethora of tablets iPad/Android? Here’s the answer:

Visual Studio

The perfect portable solution for a developer is right here. As a bonus, we are also able to use Outlook, Live Writer, Photoshop and so on.

Comparison

Last summer, I received a prototype Ultrabook from Intel. Here are the specs:

image

Before I got a laptop with a touch screen, I had the mentality that using greasy fingers on the screen was a terrible idea. Sorry, I was wrong. It is such a natural way to interact with a computer in some situations especially when reading. (Expect Apple to update their MacBook with touch screen this year.) This Ultrabook  with a Core i7-3667U is fast and fluid. It is a good contestant to fight with a Surface Pro with these specs:

image

On the load time test, surprisingly, the Surface Pro is the clear winner:

Boot time of an Ultrabook Core i7-3667U and a Surface Pro

It looks like a 10 seconds boot time for the Surface! This is cool, but nowadays we don’t have to turn off a computer all the time. Here is a normal test of launching Visual Studio 2012 (with Update 2 on both computers) and launching the debugger with the Windows 8 emulator:

Compilation time of a Windows 8 app with an Ultrabook i7-3667 and a Surface Pro

With the Surface Pro we have almost the time to breath an extra second while waiting.

Conclusion

Earlier this week, the Surface Pro received mixed reviews over the Internet. I was not surprised and in fact I didn’t care that much. Yes, the battery life of the Surface Pro is not stellar, but in real life, I’m not travelling around the world every day without a power charge for an entire day and I’m pretty sure it is the same case with the majority of users. The Surface Pro is an amazing device or whatever you’d like to call it. I’ll read, play and develop with it.

Congratulations to Microsoft and especially to the Surface team.

ArchieCoder

My experience with Ads in my Windows Phone apps

After some thought, I decided to share my experience with ads and to provide the revenue that my apps provided. If my details help you, then I’ll be happy.

The two apps that generates the most revenue are:

  • Ultimate Poker Hands & Timer
  • Ultimate Poker Manager Free

Those apps target a niche audience: the poker players that play home games. Although they are niche apps, these two apps are popular in the US Windows Store. If you enter “poker timer”, the apps will get the 1st and 4th places:

image

The advantage of adding an ad control into a “timer” app is you get a chance that you’ll get tons of ad requests. I was curious if the ad market can be good.

Smaato

Back in early 2011, there were few providers where a Canadian developer can be paid. Believe it or not, the PubCenter by Microsoft was not in the list. So, I ended up choosing Smaato. In 2011, if my memory is good I got three payments of ~$5 each. My user base was very low, so it was not that bad getting the $15.

I don’t look into the details of my ad revenue day to day, but at the end of 2012, I checked what was going on. I was quite disapointed to see that on 151 244 served ads for the last 6 months, that the generated revenue was $1.91. Unfortunately, Smaato does not provide data older that 6 months. I contacted the support on their website, but I never got any answer. I found a Twitter employee where he forwarded my question to the right team and it took more than a month before getting an answer. They did not seem to understand that the $1.91 of revenue on 150 000 ads was abnormal. At this point, I gave up and remove the Smaato ad control into my apps. It is not fair is only one company is making money.

image

Microsoft PubCenter

At the end of 2011, the PubCenter finally arrived in the Canadian market. I decide to make the PubCenter my primary ad provider and when an ad request cannot be fulfilled, the Smaato would try to request an ad. So, it doubles my chance to display an ad.

What you see is $32.06 for 135 205 ads. I’m not an ad guru, but those numbers seem fair to me.

I would like to point out that integrating the Smaato and PubCenter ad controls into a Windows Phone app is almost as easy to drag a button into a page.

image

Nokia NAX

In the autumn of 2012, Nokia released the NAX ad network that supports multiple platforms. As a big fan of Nokia, I decided to give a try. We always have a dream to become rich :) I put the NAX as the primary ad provider and use PubCenter as the backup.

The NAX ad network is powered by the company inneractive.

When I first integrated the NAX ad control, it took me some time to figure out that the AdFailed/AdRequest events were static events and does not belong to the control. To use the NAX Ad Control it was not as easy as Smaato or PubCenter.

When I ported my two apps to Windows Phone 8, the NAX ad control was not even released despite having all other non-Windows Phone platforms. I was a bit surprise, but they told me that I can use the WP7 version.

The first surprise

After my apps were updated with the NAX Ad control, I received a couple of days later a crash report showing that the AdFailed event generated an exception because it was not returned in the UI thread. When you are using an ad control in an app, you expect that the ad control have been tested and you can have confidence in it. By definition, an ad control fetches an image and display it every 60 seconds, right? I immediately contacted the support. Without too much surprise, they confirmed the crash and told me to update my apps.

I updated my apps and waited for the certification time… That part is not fun to wait when you know your users can have random crash without even touching the timer page.

I gave them a chance…

Last week, I got another new crash report and I found out a 100% repro case in an app that I’m developing right now. I contacted the inneractive support and after two days, I got no answers. I reached out the NokiaDeveloperTeam Twitter account and they quickly asked for my info and forwarded it to the inneractive team. After a day, I still did not get any support. I found out the Twitter account of inneractive and I got a reply right away. Once again, they forwarded my info the the engineering team. I won’t go into details, but the inneractive engineers do not seem to understand the WP platform and I’m still waiting for an answer or an update for the current situation.

On top of that, I got another new crash report today.

Two person from Nokia are aware about my situation and they asked me my feedback and I’m keeping up to date. It is way more important for Nokia to know what’s going on with their contractor inneractive. Nokia thanked me for my feedback to them.

If I put aside the negative experience with the NAX ad control, the numbers are impressive so far (it is less than 40 days): $0.85 for 3853 served ads.

image

In conclusion, I would suggest to avoid the NAX Ad control for now, it is not ready for prime time yet. The PubCenter is my top suggestion. I know I won’t be rich with my two apps, however, the part where I’m the more happy with is over 320 000 ads that have been requested over the last 2 years and if one ad is requested every 60 seconds, it represents 5333 hours of usage of my apps.

Happy New Year of coding!

Review of Building Windows 8 Apps with C# and XAML

imageDuring the holiday season, I received the Building Windows 8 Apps with C# and XAML by Jeremy Likness. Holidays are the perfect time to read books! Before starting the book, I was curious to know if it would be useful to me, since I created my first Windows 8 app (Canadian Developer Connection) earlier this year where I included a lot of Windows 8 features. It turned out that I was very satisfied with the number of things I learned.

The reader should have extreme confidence in the content of the book, given the author’s solid experience and background.

The book starts with a simple app that is more than just a “Hello World” app. After the first app, a beginner would be happy to read and learn more.

The author took the time to explain some “under the cover” mechanisms of the new Windows 8 Store app world. Yes, the Registry is still present more than ever. This information is very much appreciated.

Reading about the controls, the application lifecycle, the way to save data, the charms, the packaging, the deploying and more, the reader will get a complete picture of how to take advantage of Windows 8 features.

One of the most important aspects about programming is testing. Even though this aspect is not only related to Windows 8 development, the author dedicates a whole chapter to testing and the high importance of doing unit tests. The experiences that he wrote about proved that even more. For all levels of developers, this chapter is a good reminder of one of the aspects we tend to push aside.

Throughout the book, there is code that is available open-source. The book is a great companion to the provided code and some of the code can even be used in your own apps.

As for the physical aspects of the book, the font size is easy on the eyes. The book could have been a bit better if there were colors in the diagrams, but undoubtedly the price would have then been higher. The current price of the book on Amazon USA is $28.99 and $32.59 on Amazon Canada. At this price, it is really worth buying.

In conclusion, the book covers all the new cool features of the Windows 8 Store apps. If you know C# and you want a quick start on Windows 8 App development, I recommend this excellent book.

How to avoid application settings corruption when a background agent is used

LIke most of my applications, I used to save all my application settings in the IsolatedStorageSettings.ApplicationSettings. It seems like a logical good choice. In my last application, I added a Background Agent to my project. When I was looking for best practices on how to exchange settings between the background agent and my application, I came across with this text from the MSDN library:

For Periodic and Resource-intensive Agents: Use LINQ 2 SQL or a file in isolated storage that is guarded with a Mutex. For one-direction communication where the foreground app writes and the agent only reads, we recommend using an isolated storage file with a Mutex. We recommend that you do not use IsolatedStorageSettings to communicate between processes because it is possible for the data to become corrupt.

After, I found someone who implemented a solution that uses a Mutex. While the solution is good, the only problem is that his personal settings are mixed with the IsolatedStorage operations.

To help the reuse of the solution in different projects, I created a IsolatedStorageHelper class. Also, instead of relying on the XmlSerializer in order to save an object, I based my solution using the powerful library of Json.NET.

Usage

The IsolatedStorageHelper has three methods:

  • WriteObjectToFileUsingJson
  • ReadObjectFromFileUsingJson
  • IsFileExists

Here is the example that uses all the methods:

Settings mySettings = new Settings();

IsolatedStorageHelper.WriteObjectToFileUsingJson("Settings.txt", mySettings, "MyMutexName");

if (IsolatedStorageHelper.IsFileExist(SettingsFileName))
{
    Settings = IsolatedStorageHelper.ReadObjectFromFileUsingJson<Settings>("Settings.txt", "MyMutexName");
}

To use the IsolatedStorageHelper in your project:

1- Add the IsolatedStorageHelper.cs file into your project.

2- Add the Nuget package Json.net.

If your project does not have a background agent, you can still use my utility class, you can omit the mutexName parameter of the WriteObjectoToFileUsingJson and ReadObjectFromFileUsingJson.


Download

XAML coding convention

Over the past year, I have built my own coding conventions for C#. I also always manage to convince my colleagues to follow my coding convention if they don’t already have one. I’m a real freak about following coding conventions; if I see someone modifying one of my files and not following my conventions, I might have trouble sleeping at night (ok, not that much, but…).

With the help of the great Visual Studio add-on ReSharper, it’s easy to format code with rules. You only need to press Ctrl-E/Ctrl-C to format a document. ReSharper is a must have tool for Visual Studio.

For the past two years, since the release of the Windows Phone platform, I have been using the XAML language to program my user interfaces. Finding coding conventions for C# is pretty easy, but for XAML, it was a bit more of a challenge. My first move was to check the default Microsoft projects, but I concluded that even they are a bit messy even for today.

Here is an example of a WIndows Store Grid App project:

<ListView.GroupStyle>
    <GroupStyle>
        <GroupStyle.HeaderTemplate>
            <DataTemplate>
                <Grid Margin="7,7,0,0">
                    <Button
                        AutomationProperties.Name="Group Title"
                        Click="Header_Click"
                        Style="{StaticResource TextPrimaryButtonStyle}">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Title}" Margin="3,-7,10,10" Style="{StaticResource GroupHeaderTextStyle}" />
                            <TextBlock Text="{StaticResource ChevronGlyph}" FontFamily="Segoe UI Symbol" Margin="0,-7,0,10" Style="{StaticResource GroupHeaderTextStyle}"/>
                        </StackPanel>
                    </Button>
                </Grid>
            </DataTemplate>
        </GroupStyle.HeaderTemplate>
    </GroupStyle>
</ListView.GroupStyle>

First of all, there are not any empty lines, and secondly the button has attributes on separate lines, but for the TextBlock elements, the attributes are on the same lines without any order.

With time, I developed my own XAML coding convention that I would like to share. One of the reasons that I developed my own XAML coding convention is I don’t like to use the Properties window, because it is hard to have an overview of the properties that are not set to default.

image

My coding convention is resumed in 5 points:

1- Put empty lines between elements.

Don’t be afraid to put empty lines. It makes reading the code easier.

<Grid Height="250"
      VerticalAlignment="Top">

    <Image Source="{Binding FeatureArticle1.Thumbnail}"
           Style="{StaticResource ImageThumbnailStyle}" />

    <StackPanel Style="{StaticResource StackPanelSummaryStyle}">

    <TextBlock FontSize="22"
               Style="{StaticResource TextBlockAuthorStyle}"
               Text="{Binding FeatureArticle1.Author}" />

    <TextBlock FontSize="26"
               Height="70"
               Style="{StaticResource TextBlockSummaryStyle}"
               Text="{Binding FeatureArticle1.Title}" />

    </StackPanel>

</Grid>

My exceptions are the Grid.ColumnDefinition and Grid.RowDefinitions, because they only have one line attribute.

<Grid.ColumnDefinitions>
    <ColumnDefinition Width="200" />
    <ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>

<Grid.RowDefinitions>
    <RowDefinition Height="200" />
    <RowDefinition Height="140" />
</Grid.RowDefinitions>

2- Put one attribute per line.

<TextBlock FontWeight="Bold"
           Foreground="White"
           HorizontalAlignment="Right"
           Margin="0,0,12,0"
           Text="{Binding ArticlesCountText}"
           TextWrapping="Wrap" />

3- Order the attributes alphabetically.

<Image Source="/Assets/Shares/NeutralImage.png"
       Height="125"
       HorizontalAlignment="Center"
       Width="125"
       Stretch="UniformToFill"
       VerticalAlignment="Center" />

Some will argue that Height and Width should be side by side or on the adjacent line, but I still prefer the alphabetical order, because it is much easier to read when you know what order your definitions are in. Also, if there is an element with many attributes, it is much easier to check whether an attribute is missing.

4- Put the attached properties at the beginning and in an alphabetic order.

<Button Grid.Column="1"
        Grid.Row="2"
        Command="{Binding ShowWriterCommand}"
        CommandParameter="{Binding WriterAshley}"
        Style="{StaticResource HubTileButtonStyle}" />

The Grid.Column / Grid.Row are the classic examples.

5- Definition of styles can be less strict.

When I’m creating styles with Expression Blend, I tend to leave them as-is when they are big. It is more about saving time than anything else. However, when a style is small, I don’t put empty lines and I put the properties in an alphabetic order like this:

<Style x:Key="GridFeatureStyle"
        TargetType="Grid">
    <Setter Property="Height"
            Value="194" />
    <Setter Property="VerticalAlignment"
            Value="Top" />
    <Setter Property="Width"
            Value="194" />
</Style>


Conclusion

It might not be the perfect solution for you, but if you do not have one, my convention is a good start especially if you are sharing code with colleagues.

My motto about coding convention is the following: it is better to have a coding convention than not having one!

Happy coding!

Canadian Developer Connection: Now available in the Windows Store

For the past few months, I have been working on my first Windows Store app for Windows 8 called Canadian Developer Connection. Since yesterday, my application is now available in the Windows Store. The Canadian Developer Connection includes all the articles, videos-on demand, events, resources and more from the Microsoft Canadian evangelist team. Even if you are not a Canadian, the application contains useful information for any developers interested in Microsoft technologies.

Here are some screenshots:

Screen shot 1

Screen shot 2

Screen shot 6

Screen shot 7

The application allows you to stream a video to any Play To devices like an Xbox 360.

At the same time, I updated the Windows Phone version to includes the videos on-demand series and the developer events.

1 of 8

Don’t miss anything from the Canadian Developer Connection and download both versions!