Category Archives: Windows Phone

DDD North 2 – Windows Phone agenda app

I’m hoping that the DDD North 2 Windows Phone agenda will make it into the marketplace in time for the event on Saturday!

I did manage to get the app certified in time, however a last minute agenda change forced another upload! I *will* make a start to a generic version on Monday, honest!

If it doesn’t, and you have a developer unlocked phone, please feel free to download the .xap file. You can use the Application Deployment tool to side-load it on to your device.

Download and side-load the .xap file!

5
12
34
5

DDD10 Windows Phone Agenda application

I am pleased to announce that a Windows Phone version of the DDD 10 agenda as just cleared certification. It’s likely to be available during Wednesday 29th August. [Update: it’s here]

I have submitted an update to take into account changes that were made to the agenda over the last few days; hopefully that app update will make it through in time for the event itself!

I know I said it last year, but I do hope to add some features to the next version that will make it pull updates down from a web-site, thus removing the need for agenda updates to require a rebuild and re-submission to the Marketplace. With any luck, the DDD North agenda app will be the first to enjoy some updates.

12
34
5

Windows Phone Camp – 12th November 2011 – Edinburgh

What:
If you are a developer looking to start developing for Windows Phone, but you haven’t yet taken the plunge, this free day of training is the quickest way to find out all you need to know. You’ll get all the information you need to get up to speed with Windows Phone in a packaged and compressed form, ready for your consumption, without having to trawl through books, blogs and articles on your own. There will be experienced people available to guide you through a series of hands-on workshops and tutorials, allowing you to work at your own pace and select what is most useful for you. Once you have the basics in place, you’ll be off and running and ready to develop your own apps.

Where:
John McIntyre Conference (Microsoft Event)
Edinburgh First
Pollock Halls
18 Holyrood Park Road Edinburgh EH16 5AY
United Kingdom

When:
12 November 2011

Further Info:
https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032496497&Culture=en-GB

DDD North Agenda – coming to Windows Phone…

DDD North LogoI’m pleased to announce that I’ve written my first Windows Phone application! It’s not an application that will land space shuttles or control your orbiting satellites, however it’s a first step! It’s a small application that will save you carrying around a printed copy of the DDD North agenda!

I had a false start last week, whereby the application didn’t meet Windows Phone Marketplace regulations, for a reason I won’t mention here. On the premise that the regulatory infringement had nothing to do with my code, I’m expecting the application to hit the Marketplace this week.

I’m planning to extend the application to be more generic such that it will handle future DDD events, whether they have two tracks, three tracks or however many tracks, etc. And, of course, I’ll be recompiling the application for Mango…at some point during the Fall or Holiday season.

12
34

If you have one of those other devices, one of the DDD North speakers has produced a similar “app” for their platform! I’m sure that “apps” for the green fruit vendor’s device are also available!

Protecting your #windowsphone intellectual property using Dotfuscator

Justin Angel‘s Windows Phone Marketplace Statistics post makes very interesting reading. Justin has done a stellar job downloading all of the Marketplace applications and performing a lot of statistical analysis.

I was particularly interested in one of the statistics: 97% of Marketplace apps aren’t obfuscated. On the off chance that you haven’t come across obfuscation yet, here’s something from wikipedia to get you started:

Obfuscation is the concealment of intended meaning in communication, making communication confusing, intentionally ambiguous, and more difficult to interpret.
http://en.wikipedia.org/wiki/Obfuscation

Obviously this means that a mere 3% of the apps in the Marketplace have some form of obfuscation. Justin was looking for PreEmptive Solutions Dotfuscator signatures, which is currently the only Windows Phone obfuscater available. Regardless of the obfuscation monopoly, 3% for what is currently the de facto tool is surprisingly low and worrying. I think back to my days in academia and how source code was something to be protected. Getting your hands on somebody else’s code was (for some students) a real boon – if you were struggling, picking up a top student’s discarded source code could provide you with something from which gave you a start. I witnessed this a few times, it happened “back in the day”, and I’m sure it still happens today.

Traditionally, we’ve used reflection to provide us with some insight as to the contents of .net assemblies. We used, almost exclusively, .NET Reflector, although recently we’ve seen similar offerings from JetBrains (dotPeek) and Telerik (JustDecompile) to name but two other reverse engineering or decompilation tools. Typically, these tools looks for .dll or .exe files. Windows Phone apps are deployed via a .xap file, we need to crack open the .xap and extract the .dlls that we are interested in looking at. Given that .xap files are actually no more than .zip files, we can simply rename the .xap to .zip and pull out the .dlls from there.

An Example
About 20 years ago (ahem!), my Pascal tutor set us a programming exercise. The full details are documented in this post. In a nutshell, we had to create a [Pascal] program that accepted a letter A thru Z and plotted a text-based triangle, where the chosen letter was the “middle” of the triangle. Once you see the screenshot (and the code), all will become clear.

Needless to say, the problem wasn’t as simple as it sounded. As soon as students demonstrated a solution, others were keen to look at the algorithms and tricks used to arrive at the solution. The code below presents a re-hashed version of my original submission, updated slightly such that it runs as a Windows Phone app.

     private void button1_Click(object sender, RoutedEventArgs e)
        {
            char widest_char;
            int next_char, finish_char, wide, range, direction, position, spacelength, loop;

            widest_char = 'F';

            wide = (int)widest_char;
            direction = 1;
            spacelength = 1;
            position = 1;

            next_char = 66;
            finish_char = 65;

            range = 2 * (wide - finish_char);

            // Calculate initial left indent
            int mid = wide - 65 + 1;

            String firstLetter = Char.ToString((char)finish_char);
            firstLetter = firstLetter.PadLeft(mid + 1);

            textBlock1.Text = firstLetter + "\n";

            for (loop = 1; loop < range; loop++)
            {
                textBlock1.Text += (" ".PadLeft(mid - position));
                textBlock1.Text += ((char)next_char);

                textBlock1.Text += (" ".PadLeft(spacelength));
                textBlock1.Text += ((char)next_char);
                textBlock1.Text += "\n";

                next_char = next_char + (1 * direction);
                position = position + (1 * direction);
                spacelength = spacelength + (2 * direction);

                // Flip direction when the middle of the diamond is reached
                if (next_char == wide) direction = -1;
            }

            textBlock1.Text += firstLetter;
            textBlock1.Text += "\n";            
        }

Here's a screenshot of the output:

Visual Studio 2010 created a .xap file that was deployed to the emulator or physical device. In order to extract the .dll that makes up the diamond application, we rename the .xap file as a .zip file, from there it's just copy and paste.

It's a different story for dotPeek now. It can still inspect the .dll with ease, however the meaningful variable names have been largely lost. The crux of this particular code example revolves around the algorithm that is used to create the diamond shape - some students were very keen to get a glimpse of an algorithm! The algorithm is still very obvious from the code fragment below:

private void button1_Click(object sender, RoutedEventArgs e)
    {
      char ch = 'F';
      int num1 = (int) ch;
      int num2 = 1;
      int totalWidth = 1;
      int num3 = 1;
      int num4 = 66;
      int num5 = 65;
      int num6 = 2 * (num1 - num5);
      int num7 = num1 - 65 + 1;
      string str1 = char.ToString((char) num5).PadLeft(num7 + 1);
      this.textBlock1.Text = str1 + "\n";
      for (int index = 1; index < num6; ++index)
      {
        TextBlock textBlock1 = this.textBlock1;
        string str2 = textBlock1.Text + " ".PadLeft(num7 - num3);
        textBlock1.Text = str2;
        TextBlock textBlock2 = this.textBlock1;
        string str3 = textBlock2.Text + (object) (char) num4;
        textBlock2.Text = str3;
        TextBlock textBlock3 = this.textBlock1;
        string str4 = textBlock3.Text + " ".PadLeft(totalWidth);
        textBlock3.Text = str4;
        TextBlock textBlock4 = this.textBlock1;
        string str5 = textBlock4.Text + (object) (char) num4;
        textBlock4.Text = str5;
        TextBlock textBlock5 = this.textBlock1;
        string str6 = textBlock5.Text + "\n";
        textBlock5.Text = str6;
        num4 += num2;
        num3 += num2;
        totalWidth += 2 * num2;
        if (num4 == num1)
          num2 = -1;
      }
      TextBlock textBlock6 = this.textBlock1;
      string str7 = textBlock6.Text + str1;
      textBlock6.Text = str7;
      TextBlock textBlock7 = this.textBlock1;
      string str8 = textBlock7.Text + "\n";
      textBlock7.Text = str8;
    }

Obfuscating the .xap using PreEmptive Solutions' Dotfuscator, changes the playing field quite significantly. Whilst Dotfuscator can obfuscate a Windows Phone .xap file, we still have to rename it to a .zip before we can inspect the assemblies found inside it. Extracting the assembly that draws the diamond, then firing it through dotPeek results in the following, rather lengthy, code fragement:

 private void ᜀ(object A_0, RoutedEventArgs A_1)
    {
      int A_1_1 = 6;
      switch (0)
      {
        default:
label_2:
          char ch = 'F';
          int num1 = (int) ch;
          int num2 = 1;
          int totalWidth = 1;
          int num3 = 1;
          int num4 = 66;
          int num5 = 65;
          int num6 = 2 * (num1 - num5);
          int num7 = num1 - 65 + 1;
          string str1 = char.ToString((char) num5).PadLeft(num7 + 1);
          this.textBlock1.Text = str1 + MainPage.b("ሗ", A_1_1);
          int num8 = 1;
          int num9 = 1;
          while (true)
          {
            switch (num9)
            {
              case 0:
label_8:
                num2 = -1;
                num9 = 5;
                continue;
              case 1:
              case 4:
                num9 = 3;
                continue;
              case 2:
                if (num4 == num1)
                {
                  num9 = 0;
                  continue;
                }
                else
                  goto case 5;
              case 3:
                if (num8 < num6)
                {
                  TextBlock textBlock1 = this.textBlock1;
                  string str2 = textBlock1.Text + MainPage.b("㠗", A_1_1).PadLeft(num7 - num3);
                  textBlock1.Text = str2;
                  TextBlock textBlock2 = this.textBlock1;
                  string str3 = textBlock2.Text + (object) (char) num4;
                  textBlock2.Text = str3;
                  TextBlock textBlock3 = this.textBlock1;
                  string str4 = textBlock3.Text + MainPage.b("㠗", A_1_1).PadLeft(totalWidth);
                  textBlock3.Text = str4;
                  TextBlock textBlock4 = this.textBlock1;
                  string str5 = textBlock4.Text + (object) (char) num4;
                  textBlock4.Text = str5;
                  TextBlock textBlock5 = this.textBlock1;
                  string str6 = textBlock5.Text + MainPage.b("ሗ", A_1_1);
                  textBlock5.Text = str6;
                  num4 += num2;
                  num3 += num2;
                  totalWidth += 2 * num2;
                  num9 = 2;
                  continue;
                }
                else
                {
                  num9 = 6;
                  continue;
                }
              case 5:
                if (1 == 0)
                  ;
                switch (1 == 1 ? 1 : 0)
                {
                  case 0:
                  case 2:
                    goto label_8;
                  case 1:
                    if (0 == 0)
                      ;
                    ++num8;
                    num9 = 4;
                    continue;
                  default:
                    goto case 1;
                }
              case 6:
                goto label_15;
              default:
                goto label_2;
            }
          }
label_15:
          TextBlock textBlock6 = this.textBlock1;
          string str7 = textBlock6.Text + str1;
          textBlock6.Text = str7;
          TextBlock textBlock7 = this.textBlock1;
          string str8 = textBlock7.Text + MainPage.b("ሗ", A_1_1);
          textBlock7.Text = str8;
          break;
      }
    }

Clearly the Dotfuscator version is much harder to understand. This is about as far as most obfuscation methods can go, they won't make it impossible to reverse engineer your application, but they will make it very time-consuming for those trying to read and understand the code.

If you are planning to obfuscate your Windows Phone apps, be sure to test them after they have been obfuscated. Like any tool that alters code post-compile, there is a chance that something may cause your app to fail. As part of the Windows Phone SDK, the Application Deployment tool is your friend. It will let you deploy .xap files to the emulator or a physical device outside of Visual Studio 2010. In other words, once you've built and tested your app, after you've obfuscated the .xap, use the Application Deployment tool to re-test the deployment.

Of course, if you are targeting Windows Phone Mango, all of this becomes rather academic. As Justin points out, from Mango onwards, .xap files will be DRM protected. Whilst your .xap will be downloadable from the Marketplace, the file itself can't be cracked open in the same way I mentioned earlier in this post. However, if you are planning to target Windows Phone 7.0 "NoDo" 7392/7390 builds, obfuscation might be something for you to consider.

Smartphones: unbalanced exposure? [Part 2 of 2]

I’m not slating the phone vendors in this post, however their web-sites don’t lend themselves to selling Windows Phone devices. I visited five of the the UK’s most popular phone vendors and found a disappointing slant towards ‘droid devices and Samsung as a device supplier.

O2’s site had a “Phones with the best” drop-down menu that included “Android operating system” in the drop-down. I’m with O2, as is my wife, we think they’re great…however c’mon guys, that menu option is very wrong!
O2

Vodafone had some promise. However that good feeling soon disappeared when they offered to help me choose between iPhone, BlackBerry and Android. Their selector wasn’t much help, it was too limiting.

vodafone

Three were very much the same, just offering direct links to the big three, “i” device, ‘berry and ‘droid.
three

T-Mobile shared O2’s weird classification, including operating systems and phone suppliers in their choice:
t-mobile

Orange had a dedicated link to a Windows Phone 7 page, which was good. However the emphasis on the “i” products is still there. Notice that the “i” tablet device is listed separately, yet there is a “tablets and pads” section.

orange

It’s not just me…
notjustmenotjustme2

How easy is it to find Windows Phone devices once at a carrier’s web-site?
I am pleased to see that O2 have a dedicated Windows Phone 7 page on their web-site: O2 – Windows Phone 7.

Similarly, Orange have a dedicated Windows Phone 7 page on their web-site: Orange – Windows Phone 7.

Vodafone’s page was rather disappointing, so here are the direct links to today’s phones: HTC 7 Trophy and LG Optimus 7

I couldn’t find any Windows Phone 7 devices on the Three web-site. I was under the impression that they were going to carry the Samsung Omnia 7, it seems not.

T-Mobile didn’t have Windows Phone 7 device offering either. Again, I was sure that they were carrying the Samsung Omnia 7, evidently not.

Hopefully this is a situation that will change as soon as Nokia get their marketing and distribution engines fired up.

Smartphones: unbalanced exposure? [Part 1 of 2]

In my last post, I was singing the praises of Windows Phone and the devices that it’s installed on. This post is going to serve as a brain dump of my thoughts relating to smartphone marketing, as I see it in the UK. It seems so unbalanced, it seems to favour specific devices, platforms and device providers.

Since it’s launch, Windows Phone has picked up significant momentum such that it is a very credible alternative to the other black slab smartphones that are out there. I’m not planning to use this post to share huge amounts of “market share” information with you, there are plenty of sites doing that already, some better than others. However, what I do want to get off my chest is the unbalanced advertising that I see for the other black slabs. Everywhere I turn, I see full page spreads offering me ‘droid devices, ‘berry devices or the “i” device. Around about the launch of Windows Phone during late 2010, I did see some newspaper adverts, however they seem to have all but dried up.

So what’s the deal? How do the phone vendors and carriers decide which devices to promote? I’ve heard that in the US, staff that sell a particular device receive additional commission. I can’t imagine it’s much different here in the UK. However, since it’s always the ‘droid devices, the ‘berry and the “i” devices that are the subject of such huge promotion, it makes me wonder how Windows Phone devices will ever reach the mainstream. I’m fairly hooked into the developer community and I know that there is a lot of excitement in the Windows Phone application development space. What can we do to take that excitement and enthusiasm for the device out to the consumers?

That leads to my next question, are the phone vendors and their staff geared up and armed with sufficient knowledge to sell Windows Phone devices? If they are receiving a higher commission for selling a ‘droid device over a Windows Phone device, why should they skill up on Windows Phone? All they have to do is convince the customer / punter that the ‘droid device is the device they are looking for. The playing field has to be levelled if there is to be genuine competition. The phone vendors need to play a major part in balancing their pitch point and they need to ensure that their staff are given all the necessary training to be able to compare, contrast and sell Windows Phone, ‘droid, ‘berry and “i” devices.

The key draw of the application logos in the cutting below is clearly there to capture the social audience, those with an interest in online shopping and the casual mobile gamer. Windows Phone can do all of that; it has an official Twitter app, an official eBay app, an official Facebook app, Amazon and of course the much-played Angry Birds. So why does this particular advert need to use an array of five non-Windows Phone devices? Both adverts in this post carried the word “free”, yet also had a monthly cost of £15 or £25 attached. There is the obvious irony of “here’s something for free, that will cost you ££ per month”, however that’s not for discussion here!

Choice is important in the marketplace, so why offer such an array of devices, yet limit the actual choice of phone operating system? I’m confused, I’m looking for answers and I can’t find them; well none that don’t involve money in some way.

Perhaps this is what the marketplace actually wants? Is today’s phone buyer driven by much little more than the knowledge the device is the right colour, it looks good and it can run Facebook and Angry Birds? What does the competition really look like? Are we looking at an underworld of competition between Apple, Google and RIM? Looking at the vendor sites, it certainly looks like it’s a tight market with directed competition. I really want to see Windows Phone succeed and make its way into the “top 3” sooner rather than later. However, until the phone vendors and carriers iron out their competitive issues, I think it’s going to be a struggle.

Of course, Microsoft’s partnering with Nokia should provide a means of getting Windows Phone devices in front of vast numbers of consumers, certainly in Europe. I understand that Nokia have built bridges with the carriers in the USA, which does bode well for market penetration over there too. Nokia are well-known in Europe, they’ve recently ordered a couple of million devices, which suggests that they mean business. One would hope that with the might of Nokia, its existing distribution infrastructure and its need to succeed in the smartphone space that we’ll see some serious competition for the “i”, ‘berry and ‘droid devices that are omnipresent in the newspaper adverts.

I’m keen to hear what you have to think about this subject, please feel free to comment. Thanks in advance!

In the meantime, ignore the phones above, the Windows Phone devices below can run all of the big name apps, games and tools!

And there’s all this other Windows Phone swag at Amazon too!

40 days and 40 nights with #WindowsPhone 7

In July, I finally gave in and won a bid on eBay. I rarely win bids on eBay, apart from the ‘buy it now’ variety, but that just equates to online shopping. I had been bidding on Windows Phone 7 devices, not thinking my bid would actually be considered good enough to actually win the goods. Of course I won the goods and had to pay up. I became the proud owner of an HTC HD7, two batteries, a desktop dock, car cradle, a carry case and a clean install of Windows Phone 7 (build 7392).

Moving to Windows Phone 7 has been an excellent move. I feel more organised, at least when I’m on the move (I can’t say that my primary e-mail inbox is anything to gauge that statement on!) The device integrates itself with Facebook. Some folks say that’s a bad thing, it certainly hasn’t proven to be a problem for me. Being able to “link” contact records between the Facebook and any number of e-mail accounts is a real boon. Couple that with the de-duplication feature in Windows Live, no longer do I have to see multiple contact records for the same person.

Windows Phone 7 also lends itself to getting your contacts sorted out, once and for all. I had contacts in Outlook (both at home and at work) and on a Nokia handset. After “some” effort, I was able to get all of my contacts into my Windows Live account. Most of the hassle that I had during this process was down to the Nokia PC Suite software – a product I will never need to see again, ever. After a little bit of tweaking, I was able to get my personal Outlook calendar and contacts synchronising with the phone. Importantly, I was also able to get my corporate Outlook calendar synchronising too.

Prior to the HTC HD7, for corporate use, I had been using a couple of Nokia devices, a 6021 and a 7230. Both were “candy bar” style devices, one was a traditional black’n’white device, the other had a colour screen with a slide out numeric keypad. For personal use, I was using a Palm Treo running Windows Mobile 6.1. Now that I am running the HTC device as my personal phone, the Nokia devices have been retired…the corporate SIM card is in the Palm Treo. The Palm Treo is used as a phone and for managing my corporate inbox, although I do use the HTC device for this purpose too.

I am very impressed with the operating system and the device itself; here are my seven favourite Windows Phone 7 features, so far:

  1. I never need to see a duplicate contact card again
  2. The Metro styled user interface is very clean
  3. Live Tiles – active content, such as “number of unread e-mail items” or “number of unread text messages”
  4. Next appointment, date, time, unread e-mails, voicemails and missed calls “on top of the curtain” (when the phone is turned on, the curtain is down – the screenshot on the right demonstrates the curtain)
  5. There is a camera button on the phone. This is great for getting the camera application running without having to power on then tap on a couple of icons to get to the camera.
  6. It’s fast. Very fast. What with all the animations that are going on, you might expect some drag. I find the whole phone experience very snappy.
  7. Its simplicity and its wealth of configuration options. Each of the tiles that you see in the screenshot above (the curtain is up) can be turned on or off. Applications and ‘people’ can be pinned to the home screen as a tile. Pinning family members to the home screen is particularly useful, two taps and I can be sending a text or returning my wife’s calls.

So I am a convert, I’ve joined the smartphone fraternity. I am pleased that I resisted the temptation to jump on the “i” or the “‘droid” or the “‘berry” bandwagon. If you’re in the market for a new device, I would urge you to go to your local store, push past the array of “other smartphones” and hunt out a Windows Phone 7 device. I’m so enthused by the device that I’ve signed up for the developer programme – I’ll be taking my .net development experience from the desktop and the web over to Windows Phone, apps coming soon!

All of this Windows Phone 7 “goodness”, gets even better with the Mango update that should be shipping during “the fall” of 2011.