Saturday, March 26, 2011

Windows Phone 7 Connectivity Issue

It would appear that with WP7 devices you are often, at least with free wireless hotspots while out and about, better off disabling your Wi-Fi connection if you actually want to be able to connect to the internet. As far as I can tell, if you are connected to a Wi-Fi network with a weak signal, the phone doesn’t automatically fall back to one of the other connection methods (i.e 3G) on a failed/timed out network request. This means if you’re connected to a network via a bad Wi-Fi connection most or all network operations will fail until you manually disconnect.

That’s the bad news. The even worse news is that WP7 doesn’t seem to have any way to manually disconnect from a Wi-Fi network. You can delete the Wi-Fi entry, which means you are disconnected from it AND the phone won’t reconnect next time that network is in range, or you can disable the Wi-Fi feature entirely. If you do the latter, then you have to remember to turn it back on later when you want to use a good Wi-Fi network (like your home or office one).

This can lead to frustrating experiences. Earlier in the week I was in ‘store A’ which is next door to ‘store B’. Store B I have previously visited, has free Wi-Fi which I’d connected to and because my phone could see this from store A it automatically reconnected. Of course I wasn’t actually in store B, I didn’t realise I was connected to their network, and the connection was flaky because the Wi-Fi isn’t boosted and there were concrete walls and what not between the two stores. The end result was that everything I tried to do on my phone involving the internet failed… until I realised there was a Wi-Fi connection. Once I finally realised why I was having connectivity problems I tried to disconnect. Problem was, I want my phone to reconnect to that Wi-Fi the next time I visit store B, I just don’t want to be connected to it right now. That means if I delete the Wi-Fi network I have to manually reconnect next time I visit store B… not what I want. The only other thing I can figure out how to do is to turn off the Wi-Fi altogether, which I did.

The good news is that once I did that, my phone reverted to the 3G connection and I could access the internet again. The bad news is I then forgot to turn the Wi-Fi back on when I left so I used more of my monthly data plan than I intended because it was a day or two later before I realised the Wi-Fi was still off.

None of this is ideal. At the very least I should be able to manually disconnect from a Wi-Fi network without ‘deleting’ it. At best, and this is what I expected to happen, the OS should revert to the next most desirable (based on cost and speed) network when it finds the currently preferred network isn’t working as expected. Microsoft have people much smarter than me, and I’m sure at least one of them can invent some sort of heuristic algorithm to decide when to change connections and which connection to pick next.

As it stands, many ‘consumers’ would be confused by their phone not working in some places (not understanding the whole weak Wi-Fi signal issue), and technical users will be frustrated by the inability to just disconnect this one time.

Saturday, March 12, 2011

Application Domains and LINQ Reqults


Another quick note; it’s generally not a good idea to try and pass the results of LINQ queries across application domain boundaries, unless you first convert them to a list, array or other well known type.

The result of a LINQ query is typically some kind of anonymous type (often an enumerator), and that type exists only in the application domain where the original query was run and the compiler generated the type for you. Passing that type across an application domain boundary will typically result in a missing type exception. Alternatively, it could conceivably cause other unwanted code or assemblies to be compiled into the other application domain.

Convert the result to a known list, array, dictionary, or other collection avoids this problem so long as that type is known in both application domains (which all of the standard .Net ones should be).

Friday, March 11, 2011

Reporting Services Assemblies Only Work When Loaded from Disk


Just a quick note today, this time about Reporting Services.

I won’t go into too many details, but we have a Windows Service which loads nearly all of the assemblies it uses (barring the ones installed with the standard .Net Framework install) from a database, into custom application domains in memory, then unloads them when done. This means the assemblies never exist on disk.

I have just spent two days tearing my hair out, because scheduling local Reporting Services reports via this service didn’t work at one of our client sites (but did work on our test server). Server reports worked in both environments, but local reports threw an exception saying the ‘main’ report definition was invalid. Examining the exception detail showed an inner exception stating a path was invalid, which was coming from calls to System.IO.Path methods used to retrieve the version information stored in binary files (exes/dlls etc.).

At first we hadn’t noticed the version/System.IO.Path stuff and we thought the problem (given the top-level exception) was caused by us loading the report definition (rdlc) from an embedded resource. We assumed we were loading the wrong resource, or the resource was corrupt etc. Additional logging added to the service proved the retrieved definition was in fact correct.

Anyway, long story short… we solved it by installing the Reporting Services Redistributable on the server hosting the service (which is not the same server as is running the Reporting Services web server, hence the need for the install). Once the appropriate files were installed the system worked fine. It seems that code inside the Reporting Services assemblies, when working with local reports, tries to read the version number of one or more binaries (to work out what version of the rdlc to expect ?) and without the files existing on disk this process fails and throws an exception.

Most people will probably never encounter this, but on the off chance I’m not the only one who does, I thought I’d blog it for prosperity.

Saturday, March 05, 2011

Windows Phone 7 Pros and Cons

As promised in my previous review of the HTC HD7 and Windows Phone 7, here’s a shorter list of the good and bad about Windows Phone 7. Note, some things appear on both lists for different reasons.

Haven’t seen WP7 in action ? Check out this short commercial on YouTube.


  • Simple, elegant, beautiful main screen.
  • Overall, easy to use.
  • Responsive touch based input.
  • Best touch keyboard (at least in my opinion), with good auto-correct.
  • Good keyboard layouts for email and URL’s.
  • Live tiles update to show useful information (number of missed calls/unread messages/weather)
  • Quick access to camera by holding down hardware button.
  • Voice commands (hold down Windows button to activate)
  • Pin almost anything (web pages, applications, map locations, contacts) to the start screen.
  • Easy access to voice mail.
  • Easy access to call history, return missed calls etc.
  • Easy and fast integration to Windows Live (and Hotmail), Facebook and Gmail.
  • Share options from browser, camera applications.
  • No copy and paste.
  • Easy and quick access to in call phone options (hold, speaker, conference call etc.)
  • Wireless (Zune) Sync for media and podcasts
  • Text messaging based on conversations.
  • Easily attach images to text messages (MMS).
  • Easily forward text messages.
  • Easily add contacts from text messages or missed calls.
  • Link profiles from multiple services/locations into a single contact.
  • Excellent Zune based interface for playing music, media, podcasts etc. (and this will run in the background while you do other things).
  • Easily access last (and previously) taken photos from within camera.
  • Simple but functional email application with clear, easy to read text, pinch to zoom etc.
  • Tab browsing in browser (sort of, not actually tabs, but certainly multiple open pages with the ability to switch between them).
  • Develop applications using Silverlight (for WP7) and Visual Studio .Net.
  • Auto upload photos to SkyDrive.
  • Auto-strip GPS coordinates from uploaded images.
  • Find my phone feature.
  • Excellent applications for Flickr/Twitter.
  • Easy to update OS via Zune software (unless you’ve got a Samsung device, apparently).
  • Easy to update applications installed from Marketplace.


  • No custom ring tones (nor any downloaded ones in market place).
  • No direct Outlook integration (Outlook –> Hotmail –> Phone can be done with an Outlook plugin).
  • Exchange support overly difficult (I still can’t make it work) and not supported by all Exchange servers.
  • No voice guidance in maps application.
  • Navigation option in maps application only appears if ‘Browser and Search’ regional setting is set to US.
  • Quick access to the camera still needs to be quicker.
  • Camera settings not persisted between invocations of the application.
  • Live tiles concept not taken far enough – better/more information could be displayed, more tiles should be ‘live’.
  • Only about eight live tiles fit on main screen without scrolling.
  • ‘Application List’ (alternative to the main screen) provides a poor user experience.
  • Battery and signal status not always visible.
  • .com button on keyboard doesn’t provide options for common domain extensions based on regional settings.
  • Search, Windows and Back buttons are too easy to activate during games if they are capacitive buttons. Games should disable Search/Windows during play time to correct this, but usually don’t.
  • Search from within maps application is flaky.
  • Primarily touch based input – not great for txting without looking at the screen, not as fast as a hardware keyboard.
  • No multi-tasking for third party applications (rumoured to appear one day, possibly by the end of the year).
  • No favourite/frequently used contacts (only recent contacts, and only about eight of those in total with four visible at a time).
  • No direct twitter integration.
  • Share option from browser doesn’t integration with other applications (Twitter/Facebook etc.), limited to SMS and email.
  • No copy and paste.
  • No tethering.
  • Very limited Bluetooth options.
  • Cannot access/use phone as a removable drive when connected to PC.
  • Wireless Sync – limited to one wireless network, only starts sync after ten minutes of AC charging, pops-up Zune application on PC, may not cope with multiple windows profile on PC.
  • No hardware mute button (or single tap mute button on lock screen).
  • Text messaging based on conversations. Not brilliant if you prefer an inbox/outbox style arrangement, or want to easily delete messages after reading.
  • Problems with profile images disappearing from contacts (usually when contacts updated in Windows Live).
  • ‘One time’ alarms don’t get deleted when dismissed, rather they get turned off and left in the application list.
  • Problems syncing pictures from phone to PC (for many but not all users, especially those with HTC devices). Other media or in other directions work fine.
  • No Flash (at all, rumoured to be coming), no Silverlight within browser.
  • Must pay Microsoft to deploy your own software to a physical device, even if not published via the Marketplace, or just testing/trialling it. Tools and emulator are free.
  • Lack of ability to customise phone. Pretty much restricted to wall paper, selection of white or black background, and one of 11 colours for the theme. No custom rings tones, no additional colours, wall paper only shown on lock screen, can’t alter live tile sizes.
  • Moving live tiles around on main screen is sub-optimal for user experience, but not totally awful.
  • Keyboard layouts discourage strong passwords.
  • Best experience requires a data plan.
  • No ability to discover MAC address on device (for adding device to MAC address filtered wireless networks).
  • Wireless networking disabled when phone ‘locked’ to save battery – so data plan gets used instead.
  • Find my phone off by default.
  • No ability to restrict cellular connections/location service by application. System settings are all or nothing.
  • No unified inbox for email.
  • Only sync media via Zune, no support for Windows Media Player or other systems.

Friday, March 04, 2011

Copy and Paste – A Legacy Solution in a Modern World

If the rumours are true, an update to Microsoft’s new Windows Phone 7 operating system is due within the next few days. Even if those rumours prove inaccurate, the update is likely to arrive within the next month or so. The major change publicised for this update is the addition of “Copy and Paste” to the operating system.

Since WP7 was first released, forum/blog posts, online comments and reviews have been blasting Microsoft for failing to include Copy and Paste. Typically theses comments start with the poster saying they “cannot believe Microsoft didn’t include Copy and Paste, it’s 2011 already and iPhone and Android both have it !”. Arguments for Microsoft usually go along the lines of, “Well it’s version one of a completely new operating system and they didn’t have time to implement and test every feature”. From there the argument rages on, with the suggestion that while it might have been ok to release a system without Copy and Paste in 2007 (which Apple did), it’s not ok to do it now when competitors have already implemented it. There are those who have said they won’t buy a phone without support for Copy and Paste.

My question is, do we even want Copy and Paste ? Given the debate it’s clear people think they want it, but sadly, the customer is not always right.

Despite owning many phones including two prior to my new HTC HD7 that were capable of web browsing and email, I have almost never wanted copy and paste as a feature of my phone. I say almost, because on one occasion recently I wanted it for a single fleeting moment. I was viewing a web page on my phone (something I still prefer to do on a PC whenever possible) and I wanted to share it with my Twitter followers. My natural reaction was to reach for copy and paste, to copy the URL to the clipboard, change to my Twitter application and paste the URL in. In fact, it would have been worse than that. I would have had to navigate to a service like then paste the url in there, copy the output of that service and then switch to my Twitter application to paste the final value into the tweet.

Is that really what I wanted to do ? No. I wanted to share the page with Twitter users. I didn’t actually want to click, tap, drag or highlight the URL and choose to copy it. I didn’t want to switch applications, watching one screen animate to another, waiting for one application to go into the background and one to come forward.  Nor did I really want to manually go to and convert the URL, or even paste the url into Twitter. I just wanted to share the page. Any of that process might have been better (given the current state of the platforms) on iOS or Android, but it still would have been wrong.

At this point I found myself in a good news, bad news situation. Fantastically the WP7 browser includes a “share” option on it’s application bar menu. That’s what I should have reached for, that’s what I wanted. An option to share what I was viewing with a particular group of people via a specific medium, not some antiquated desktop technology from the 1970’s. The bad news is the share option, at present, only allows you to share a URL via email. There is no ability to share via Twitter, Facebook or any other service except your configured email accounts. So close, Microsoft, yet so far. This is surely an oversight on Microsoft’s part, since the camera application updates to include support for TwitPic and Flickr when the appropriate applications are installed (SkyDrive/Windows Live, email and SMS messaging are available by default).

Of course copy and paste would have allowed me to solve my problem, but we as an industry and particularly as consumers have moved past ‘good enough’ solutions. Apple’s iPhone and iPad have led the way in proving this. When Apple release a product that is missing features they are often defended by those who say it doesn’t matter features are missing, because what is there is so good. It’s the user experience that matters now, and it is through improved user experience that Apple are doing amazing things and pushing the industry forward. Given this, I’m actually surprised that Apple implemented copy and paste in their own platform. They more than anyone else should have been in a position to insist that it was the wrong answer, and provide a better solution or solutions. After all, they remain strong on their anti-Flash arguments despite criticism for it from many quarters and they have pioneered new user interface concepts.

Is copy and paste a good user experience ? Not really. It’s certainly what we’re used to, and what we’ve been conditioned to look for. It’s also relatively easy to engineer, and if done correctly can be provided by the underlying operating system and therefore operate in virtually any application without that application’s developer having to do anything. That’s also the biggest problem with it. While copy and paste is great as a fall back for when the user experience is already broken, we shouldn’t be using it when we don’t have to. We should be demanding greater and smarter integration. Copy and paste won’t run my URL through or tinyurl for me automatically, but fantastic integration between the browser and Twitter application would. If someone sends me a txt message with a name, phone number and address in it,  I don’t want to carefully copy and paste each value between applications, constantly switching between one and the other. I want to tap the info then select ‘save as contact’ and have the phone try to sort out which bit of text goes in which field in a new contact. Of course it should also allow me to tweak which data goes where if the phone gets it wrong. There are plenty of examples where copy and paste can be used, but is actually a hack to get around the fact that different applications or parts of the operating system don’t integrate the way they should.

My concern is that once we have copy and paste, improving the integration between applications becomes less important. Because we can use copy and paste, and because it’s easy for developers to implement (in fact they shouldn’t have to do anything), better integration between applications may not even be thought of let alone implemented as a priority.

I’m not upset about having copy and paste in the phone. It’s the ultimate fall back for sharing information between programs (except perhaps for the file system, which is also disappearing in the mobile space). Despite the fact I think you’re crazy to try and create Office documents (or most other sorts of document based content) on a phone, I can accept that if you do then copy and paste would probably be useful. I have to ask though, have consumers done themselves a disservice by demanding copy and paste ? Will Microsoft recognise this and resist the urge to say copy and paste is good enough ? Will we eventually see development tools that ask the developer what kinds of content the application can accept or publish every time a new one is created, and expose end points for dealing with that content directly to the operating system and other applications when it is installed on a device ?

On a desktop PC, copy and paste probably still has a place, at least for a while. It’s familiar, it works, and it’s already there. You also have a mouse and a full keyboard, which makes selecting and copying data easier. You can have non-full screen applications so copying and pasting between applications or even windows isn’t so painful. You’re more likely to be creating content, in particular complex documents with mixed data, which is where copy and paste shines. Copy and paste also works with multiple formats of data, text, images, folders & files, spread sheet cells, flow chart shapes etc. In the mobile space though, we have different problems, different input methods and most importantly the chance to do something better.

Although having copy and paste on the phone doesn’t worry me (so long as we don’t let it ruin our future), I am upset that it was given such a high priority. There are many more missing features in WP7 that would be infinitely more useful. Even custom ring tones would actually be more useful to me personally. I can only hope the impending update includes more than a thirty to forty year old technology we should be abandoning as fast as technology allows, or that future updates that include other features will ship soon after.