Forget Metro.
Forget tablets.
Forget WinRT.
Forget building apps in HTML/JS.
The absolutely most important thing developers (and anyone involved in the creation, design, sale, marketing, etc. of software) need to know is based on the fact that it is designed to be used on multiple devices.
Which leads to my point. People (your users/customers) are starting to use a wider variety of devices. And not only that, they are using them in different/new ways and this requires that the applications which run on them work/behave in different/new ways too.
Windows 8 tells "desktop" developers they MUST start thinking about developing for multiple devices and uses.
Whether it's a 10" tablet, a 15" laptop or a desktop PC with a 32" screen, these different form factors encourage use in different ways. But that's just an example of where we'll initially see Win8. There's also the even smaller tablet and phone devices. There's table based interfaces. There's wall sized interfaces. There's also many more we probably can't even begin to imagine yet. Even in Sci-Fi films. But one day, probably sooner than you think, we'll be building apps to run on such devices.
If you've heard me talk at any point in the last 4 years or so, you will have inevitably/hopefully heard me say that all developers should start learning about developing for mobile NOW as it will help prepare you for all the plethora of devices they'll inevitably end up building for in the future.
If you're a developer who currently only targets the laptop/desktop environment usage scenario whether for APPS OR WEBSITES and you care about how your skills will meet the future demands of the marketplace. I can't recommend strongly enough that you should go and learn about HOW developing for mobile is different.
I'm not saying you should go and learn how to build apps for Windows Phone, iPhone or Android, etc. What you need to know is how apps designed for those platforms are different from ones that run on the "desktop".
If you have experience developing apps for the desktop environment you'll bring with you (whether you intend it or not) a number of assumptions and expectations about what your app should look like, how it should work and how people will use it. The good thing about mobile development is that it challenges all these common assumptions and so forces you to think differently.
Once you know how to challenge your thinking about these areas regarding mobile development you'll be prepared and ready to approach developing for other devices, form factors, etc. in a way which will help you create apps which work well on that platform.
In turn this will lead to apps which are easier (possible?) for your users/customers to use. Which can only be good for you/your company. Afterall, if people can't use your software they wont do so for long. This makes it much harder to get repeat business or referals.
Alternatively if your business is based on income from selling support contracts then you probably want (or need?) your software to be bad. So you should probably check out all the things you shouldn't be doing as it would only make your app better.
Side note.
You may try and argue that previously PC apps were used on PCs and laptops. But, seriously, can you show me the apps you have been building which allow for these (slightly) different environments. Thought not.
Matt Lacey's Blog
Mostly mobile development notes (primarily Windows Phone 7 recently) but also my assorted thoughts on anything else that springs to mind.
Tuesday, December 13, 2011
Friday, December 09, 2011
Windows Phone 8 and WinRT
I've heard a lot of people claim that they think that the next major version of Windows Phone (which they assume will be called Windows Phone 8) will use WinRT as part of the phone's OS. I don't.
At this point I should state that even though I have spent a few months earlier this year working at Microsoft (in their Windows Phone Centre of Excellence). I do not have any insider knowledge of Windows Phone beyond what has already been publically released.
Here's why I don't think that the next version of Windows Phone (whether it's called 8 or "apollo" or anything else the internets may speculate at): Time!
WinRT is part of Windows 8 (if you weren't aware).
What's the timeline for the release of Win8?
We don't know, but I'm going to make a, hopefully, intelligent guess.
The only thing we know about it were announced back in September (at BUILD) when it was in the pre-alpha stage. Based on that and what we know from the time it's taken for previous Windows operating systems to be released, I think we'll be lucky to see it publically available before the end of 2012. There are some rumours that we may see a beta in early 2012 which sounds reasonable and ties in with what we might expect.
What about Windows Phone v.Next? (Which from now on I'll call WP8 to save typing.)
Again there is no public information on timelines for releases but we can make some informed decisions based on a knowledge of the "mobile space", the release schedule of other mobile operating systems and the timeframes over which WP 7.0 & 7.1/7.5 were released. I don't think it's unreasonable to expect to have details of WP8 announced in February, have an SDK released around April/May and have general availability/public rollout around September.
That means that, realistically, the details of WP8 need to be fairly locked down by February (if not several months before). At this time Win8 could still be in a very variable position. I don't see Microsoft letting WP8 dictate feature lockdown for Win8 (and it shouldn't). Similarly, Microsoft can't afford to delay WP8, possibly for many months, until Win8 is stable.
They're two separate (albeit related) operating systems which have their own requirements, uses, users and competitors and therefore require their own release schedules.
Any other arguments?
In a number of ways Windows Phone is still playing catch up to other, more mature or fully featured mobile operating systems. It's going to be better for Microsoft to spend time addressing (at least) some of these disparities and adding or refining features and functionality which will allow WP8 to compete in the mobile arena than doing things that improve parity with a desktop operating system.
Yes, sharing development resources across multiple platforms is a great thing but it's more important that the individual platforms are strong enough to compete individually. There will never be a situation where the exact same codebase will (or should!?) run on both platforms though, so perfect synchronicity is an unnecessary (and impossible?) goal.
Additionally we need to consider what WinRT actually includes.
WinRT is an alternative/update to Win32 which provides a set of APIs which can be used/consumed in the same way as the APIs of .net. Having to do things with Win32 on the desktop can be less than ideal or so difficult as to lead many/most to not even try. On the phone this doesn't matter. The only things you & I (us mere mortals - not Microsoft, operators or OEMs) can do on the phone are in managed code through a .net API (the compact framework - v 3.7). We don't have to address issues about things which are hard or impossible to do with Win32 APIs. It's not that the functionality isn't available. The whole issue is irrelevant.
Yes there are some things in WinRT that it would be nice to see in Windows Phone but I hope they can be migrated to WP without needing to make a major change to the underlying OS.
Making a dramatic change to Windows Phone such that it had anything more than a trivial impact on the upgrade path of 7.X apps would be a big issue and upset a lot of WP7 developers. At a time when Microsoft are still trying to persuade companies/developers of the merits of building apps for WP adding unnecessary hurdles to upgrade paths would not, in my opinion, be a smart move.
At this point I should state that even though I have spent a few months earlier this year working at Microsoft (in their Windows Phone Centre of Excellence). I do not have any insider knowledge of Windows Phone beyond what has already been publically released.
Here's why I don't think that the next version of Windows Phone (whether it's called 8 or "apollo" or anything else the internets may speculate at): Time!
WinRT is part of Windows 8 (if you weren't aware).
What's the timeline for the release of Win8?
We don't know, but I'm going to make a, hopefully, intelligent guess.
The only thing we know about it were announced back in September (at BUILD) when it was in the pre-alpha stage. Based on that and what we know from the time it's taken for previous Windows operating systems to be released, I think we'll be lucky to see it publically available before the end of 2012. There are some rumours that we may see a beta in early 2012 which sounds reasonable and ties in with what we might expect.
What about Windows Phone v.Next? (Which from now on I'll call WP8 to save typing.)
Again there is no public information on timelines for releases but we can make some informed decisions based on a knowledge of the "mobile space", the release schedule of other mobile operating systems and the timeframes over which WP 7.0 & 7.1/7.5 were released. I don't think it's unreasonable to expect to have details of WP8 announced in February, have an SDK released around April/May and have general availability/public rollout around September.
That means that, realistically, the details of WP8 need to be fairly locked down by February (if not several months before). At this time Win8 could still be in a very variable position. I don't see Microsoft letting WP8 dictate feature lockdown for Win8 (and it shouldn't). Similarly, Microsoft can't afford to delay WP8, possibly for many months, until Win8 is stable.
They're two separate (albeit related) operating systems which have their own requirements, uses, users and competitors and therefore require their own release schedules.
Any other arguments?
In a number of ways Windows Phone is still playing catch up to other, more mature or fully featured mobile operating systems. It's going to be better for Microsoft to spend time addressing (at least) some of these disparities and adding or refining features and functionality which will allow WP8 to compete in the mobile arena than doing things that improve parity with a desktop operating system.
Yes, sharing development resources across multiple platforms is a great thing but it's more important that the individual platforms are strong enough to compete individually. There will never be a situation where the exact same codebase will (or should!?) run on both platforms though, so perfect synchronicity is an unnecessary (and impossible?) goal.
Additionally we need to consider what WinRT actually includes.
WinRT is an alternative/update to Win32 which provides a set of APIs which can be used/consumed in the same way as the APIs of .net. Having to do things with Win32 on the desktop can be less than ideal or so difficult as to lead many/most to not even try. On the phone this doesn't matter. The only things you & I (us mere mortals - not Microsoft, operators or OEMs) can do on the phone are in managed code through a .net API (the compact framework - v 3.7). We don't have to address issues about things which are hard or impossible to do with Win32 APIs. It's not that the functionality isn't available. The whole issue is irrelevant.
Yes there are some things in WinRT that it would be nice to see in Windows Phone but I hope they can be migrated to WP without needing to make a major change to the underlying OS.
Making a dramatic change to Windows Phone such that it had anything more than a trivial impact on the upgrade path of 7.X apps would be a big issue and upset a lot of WP7 developers. At a time when Microsoft are still trying to persuade companies/developers of the merits of building apps for WP adding unnecessary hurdles to upgrade paths would not, in my opinion, be a smart move.
Monday, November 07, 2011
Recorded live at Nokia World 2011
On the 2nd day of Nokia World I was invited to be part of the audience at the recording of the 361 Degrees podcast.
Allegedly, the audience was made up of "bloggers and mobile gurus". As I'm not much of a blogger that must, finally, make me a "mobile guru"! ;) (maybe it was all the other mobile guru's I was in the presence of that made me sound so nervous.)
Listen at http://audioboo.fm/boos/534345-s02-e02-361-live-at-nokia-world-2-of-2
Nando's in London app
In, or visiting, London and want some PERi-PERi chicken but don't know where the nearest Nando's is?
Never fear, this app will help you find your nearest Nando's restaurant.
See it on a map, get directions, check facilities or just call for take away.
If you're a spicy chicken lover this is the app for you.
Ok, this was a somewhat tounge in cheek creation but it still has potential value, hopefully, to lots of people. As ever, comments, feedback, etc. appreciated ;)
Ok, this was a somewhat tounge in cheek creation but it still has potential value, hopefully, to lots of people. As ever, comments, feedback, etc. appreciated ;)
Wednesday, October 26, 2011
Nokia World Keynote Buzzword Bingo
I had the idea for this but completely forgot. If I'd remembered/had more time I'd have put this all in a proper bingo board format. Feel free to do that yourself if you so wish.
Regardless, here, in no particular order, are a few words I think we may be hearing quite a lot today:
And many more besides too, I'm sure.
Regardless, here, in no particular order, are a few words I think we may be hearing quite a lot today:
- ecosystem
- mango
- everywhere
- local
- payment
- monetization
- reach
- efficiency
- Qt
- beautiful
- opportunities
- global
- new
- smarter
- partnership
- millions
- services
- maps
- apps
- community
- developers
- knowledge
- future
- devices
- metro
- pure
- future
- alpha
- marketplace
- hub
- personal
- cloud
And many more besides too, I'm sure.
Wednesday, October 19, 2011
The popularity of TombstoneHelper
A few weeks ago, as you're probably aware, Justin Angel published an analysis of the apps available in the marketplace which included a breakdown of 3rd party libraries actually in use.
Down at number 26, is my Tombstoner helper library, which was apparently being used in 307 (or about 1% of all) apps.
It is of course very flattering to know that it is being used so widely and helping developers improve their apps. What I find interesting is how it compares with some of the other libraries available. There are a number of other libraries which have much higher download numbers (both in Codeplex & NuGet) and yet are much lower in the list. This shows that you can't take download numbers to strongly. It's actual usage that counts.
The sad thing is that with the forthcoming encryption of XAPs such analysis of the marketplace in the future will not be possible. :(
BTW. I am still planning on another version of the library. Stay tuned.
Down at number 26, is my Tombstoner helper library, which was apparently being used in 307 (or about 1% of all) apps.
It is of course very flattering to know that it is being used so widely and helping developers improve their apps. What I find interesting is how it compares with some of the other libraries available. There are a number of other libraries which have much higher download numbers (both in Codeplex & NuGet) and yet are much lower in the list. This shows that you can't take download numbers to strongly. It's actual usage that counts.
The sad thing is that with the forthcoming encryption of XAPs such analysis of the marketplace in the future will not be possible. :(
BTW. I am still planning on another version of the library. Stay tuned.
Friday, October 07, 2011
How to stop toolkit transitions affecting performance
I was recently debugging a performance issue in an app and couldn't work out why the fill rate was so high based on what was on the page.
It was so high (>3.2) that it was definitely having a negative effect on performance. Depending on who you talk to, you'll be told that the fill rate should be below either 2.5 or 3.0 to avoid affecting performance. In my experience, I've noticed performance impacted above a fill rate of 2.0 so I always aim to keep it below this.
The only exception I'll accept is a panorama with a large background image.
If you're not familiar with the Fill Rate it represents the number of pages worth of pixels that are painted in each frame. For more information on this and other performance counters see MSDN.
After much digging and as you may have guessed from the title of this post, I identified that the fill rate was higher on the pages in apps that were using the Transitions from the Silverlight Toolkit.
In fact, the culprit is the TransitionFrame.
Here's the fill rate on a simple page which uses the default PhoneApplicationFrame: The fill rate is the number at the bottom (00.0967).
If we switch over the using a TransitionFrame
The fact the fill rate is (almost) a full page made me suspect the TransitionFrame was the culprit.
If you look at the source (and scroll down a bit) you'll see that it is:
The striking thing about this is that it's painting the colour that is the same as the background behind it anyway. If the selected theme has a dark background it's painting black on top of black. Or, if the theme has a light background it paints white on white.
If we combine this knowledge of the unnecessary work the TransitionFrame is doing with the fact that anything transparent doesn't contribute to the fill rate a solution presents itself to us. We just need to make the background of the TransitionFrame transparent instead:
It was so high (>3.2) that it was definitely having a negative effect on performance. Depending on who you talk to, you'll be told that the fill rate should be below either 2.5 or 3.0 to avoid affecting performance. In my experience, I've noticed performance impacted above a fill rate of 2.0 so I always aim to keep it below this.
The only exception I'll accept is a panorama with a large background image.
If you're not familiar with the Fill Rate it represents the number of pages worth of pixels that are painted in each frame. For more information on this and other performance counters see MSDN.
After much digging and as you may have guessed from the title of this post, I identified that the fill rate was higher on the pages in apps that were using the Transitions from the Silverlight Toolkit.
In fact, the culprit is the TransitionFrame.
Here's the fill rate on a simple page which uses the default PhoneApplicationFrame: The fill rate is the number at the bottom (00.0967).
If we switch over the using a TransitionFrame
//RootFrame = new PhoneApplicationFrame();
RootFrame = new TransitionFrame();
The fill rate now jumps up dramatically (to 00.9999 - this isn't quite 1 as the SystemTray is enabled) with no visual clue as to why. Yes, a whole page of pixels is painted for no visual difference.The fact the fill rate is (almost) a full page made me suspect the TransitionFrame was the culprit.
If you look at the source (and scroll down a bit) you'll see that it is:
Yes, that's right the frame is painted with the background brush colour with every frame, as well as the page being painted.The striking thing about this is that it's painting the colour that is the same as the background behind it anyway. If the selected theme has a dark background it's painting black on top of black. Or, if the theme has a light background it paints white on white.
If we combine this knowledge of the unnecessary work the TransitionFrame is doing with the fact that anything transparent doesn't contribute to the fill rate a solution presents itself to us. We just need to make the background of the TransitionFrame transparent instead:
//RootFrame = new PhoneApplicationFrame();
RootFrame = new TransitionFrame
{
Background = new SolidColorBrush(Colors.Transparent)
};
And with this change the fill rate falls back down to it's previous level:
If you're using the transition effects from the toolkit you should definitely look to make this change to your code and create a more performant UI for your app.
Wednesday, September 28, 2011
Renewing developer phone registration
I share this in the hope that it will help out someone else in the future.
Today I was surprised to see that when I tried to run an app on one of my devices I got a message saying that the app had been revoked and I must uninstall it.
This surprised me as it was an app that is still in development.
After a bit of poking around I discovered that the developer registration for the device had expired. Yes, when you "unlock" a phone for development it only stays in that state for a year.
Dealing with this was simply a case of removing the device from the "my registered devices" list in app hub and then unlocking it again. I initially tried to unlock it again without first removing it from the list but this failed to work, despite the tool saying that unlock had been successful.
As we approach a time when devices became available to all there are likely to be lots of developers who start to see the same situation as they too will have had [unlocked] devices for a year.
Please also note that when the unlock has expired it also not possible to deploy to a device from within Visual Studio (or Blend) and you'll see a message about checking the device is developer unlocked.
Today I was surprised to see that when I tried to run an app on one of my devices I got a message saying that the app had been revoked and I must uninstall it.
This surprised me as it was an app that is still in development.
After a bit of poking around I discovered that the developer registration for the device had expired. Yes, when you "unlock" a phone for development it only stays in that state for a year.
Dealing with this was simply a case of removing the device from the "my registered devices" list in app hub and then unlocking it again. I initially tried to unlock it again without first removing it from the list but this failed to work, despite the tool saying that unlock had been successful.
As we approach a time when devices became available to all there are likely to be lots of developers who start to see the same situation as they too will have had [unlocked] devices for a year.
Please also note that when the unlock has expired it also not possible to deploy to a device from within Visual Studio (or Blend) and you'll see a message about checking the device is developer unlocked.
Tombstone Helper v2.5 now available
Just a quick note that version 2.5 of my TombstoneHelper library is now available. It fixes an issue where a textbox which had previously contained text which included a colon would throw an exception when restoring.
You can get it from nuget and codeplex.
Version 3 will hopefully be available soon. It will include support for ViewModels and the Silverlight Tookit.
You can get it from nuget and codeplex.
Version 3 will hopefully be available soon. It will include support for ViewModels and the Silverlight Tookit.
Wednesday, September 14, 2011
Windows 8 does not use Metro!
"Ooh, ooh, ooh. Windows 8 looks just like Windows Phone 7 - it's metro too."
No.
Stop.
Wait.
Metro is the name of the design language for Windows Phone 7. If you've been paying attention, everyone (who's "on message") has been saying that Windows 8 is "metro-like" or "metro inspired" or the apps are in a "metro style".
Those suffixes are important.
This isn't just me being picky. There is an important difference to be aware of.
I've seen lots of WP7 apps which don't quite "get" Metro and as a consequence don't quite feel right or worse still feel clunky or awkward or not as intuitive as a good app should or worse still don't work as expected, or like most other (including the built in) apps on the phone.
If you approach Windows 8 app development assumming it'll be exactly the same as Windows Phone 7 then you risk making a variation of those same mistakes and creating more sub-standard apps. - The world already has more than enough of them. We don't need any more. Thank you.
There are aspects of the Metro design language which are specific to the phone context:
"Focus on the individual"
"It's Personal"
"Relevant ... to your location"
These are primarily phone based characteristics.
I say this is important because I don't want you to get carried away and start thinking that you should recompile your phone apps for Windows 8 just because, in principle, it's simple to do, and just because you can.
Hopefully you've designed and built your Windows Phone 7 app to be the best it can be and to be perfectly suited for use on the phone and make the best of the platform and the screen real estate available to you. - Such an app doesn't necessarily directly translate to running on everything from a 7" tablet to a 30"+ PC monitor.
So what's different on Windows 8 when it comes to metro-like/style/inspired apps?
Expect more information about creating metro style apps to be released and made available over the coming months and be sure to check out the videos from BUILD on Channel 9. Especially the XAML related sessions (as identified by Tim Heuer).
No.
Stop.
Wait.
Metro is the name of the design language for Windows Phone 7. If you've been paying attention, everyone (who's "on message") has been saying that Windows 8 is "metro-like" or "metro inspired" or the apps are in a "metro style".
Those suffixes are important.
This isn't just me being picky. There is an important difference to be aware of.
I've seen lots of WP7 apps which don't quite "get" Metro and as a consequence don't quite feel right or worse still feel clunky or awkward or not as intuitive as a good app should or worse still don't work as expected, or like most other (including the built in) apps on the phone.
If you approach Windows 8 app development assumming it'll be exactly the same as Windows Phone 7 then you risk making a variation of those same mistakes and creating more sub-standard apps. - The world already has more than enough of them. We don't need any more. Thank you.
There are aspects of the Metro design language which are specific to the phone context:
"Focus on the individual"
"It's Personal"
"Relevant ... to your location"
These are primarily phone based characteristics.
I say this is important because I don't want you to get carried away and start thinking that you should recompile your phone apps for Windows 8 just because, in principle, it's simple to do, and just because you can.
Hopefully you've designed and built your Windows Phone 7 app to be the best it can be and to be perfectly suited for use on the phone and make the best of the platform and the screen real estate available to you. - Such an app doesn't necessarily directly translate to running on everything from a 7" tablet to a 30"+ PC monitor.
So what's different on Windows 8 when it comes to metro-like/style/inspired apps?
- Think "touch-first" but don't rule out and remember to support Mouse (& keyboard) Events.
- Embrace the touch language and don't deviate from it.
- Be prepared to scale across different screens.
- The experience should transcend the process.
- Take pride in craftsmanship
- Do more with less
- "Win as one"
Expect more information about creating metro style apps to be released and made available over the coming months and be sure to check out the videos from BUILD on Channel 9. Especially the XAML related sessions (as identified by Tim Heuer).
Tuesday, September 13, 2011
Windows Phone 7 and Windows 8
Lots of details were announced about Windows 8 today at the BUILD conference.
One thing I heard quite a bit was "if you're a Windows Phone 7 developer you're now a Windows 8 developer too".
This is because you can use the same development tools & languages and share a design language heritage.
You may recognise this as being very similar to a phrase that was used a lot last year: "If you're a Silverlight developer your now a Windows Phone 7 developer." (Because both use the same develompent tools and languages.)
That statement was as wrong then as it is now!
They are not identical and so the statements aren't true.
It's like saying "if you know how to drive a motorbike you know how to drive a bus".
If you can drive a motorbike there are lots of things you'll have learnt that will be useful when it comes to learning how to drive a bus but that there are (I imagine and hope-I don't drive either) lots of important differences too.
If you've got some experience developing for Windows Phone 7 (or Silverlight) then it'll certainly help when you want to start building for Windows 8 but don't expect it to be exactly the same.
Also, don't expect any WP7 apps to run as is on Win8. At the very minimum you'll need to recompile but you should also look to make appropriate use of a UI (& UX) which is more appropriate to Win8. And yes, I totally expect this to mean you'll likely need multiple UIs to support the plethora of devices which Win8 will run on.
I'll probably write more on this in the future, when more Win8 details are available but don't expect this fundamental principle to change.
One thing I heard quite a bit was "if you're a Windows Phone 7 developer you're now a Windows 8 developer too".
This is because you can use the same development tools & languages and share a design language heritage.
You may recognise this as being very similar to a phrase that was used a lot last year: "If you're a Silverlight developer your now a Windows Phone 7 developer." (Because both use the same develompent tools and languages.)
That statement was as wrong then as it is now!
They are not identical and so the statements aren't true.
It's like saying "if you know how to drive a motorbike you know how to drive a bus".
If you can drive a motorbike there are lots of things you'll have learnt that will be useful when it comes to learning how to drive a bus but that there are (I imagine and hope-I don't drive either) lots of important differences too.
If you've got some experience developing for Windows Phone 7 (or Silverlight) then it'll certainly help when you want to start building for Windows 8 but don't expect it to be exactly the same.
Also, don't expect any WP7 apps to run as is on Win8. At the very minimum you'll need to recompile but you should also look to make appropriate use of a UI (& UX) which is more appropriate to Win8. And yes, I totally expect this to mean you'll likely need multiple UIs to support the plethora of devices which Win8 will run on.
I'll probably write more on this in the future, when more Win8 details are available but don't expect this fundamental principle to change.
Friday, August 26, 2011
Improvements in Music & Video hub integration #wp7dev
Back in January I wrote about some of the Gotchas when integrating with the Music and Video Hub.
With the latest/mango update to Windows Phone 7 there are a couple of changes/improvements to note.
MediaHistoryItem.Source
This is property still exists and is still not used for anything but it no longer needs to be set. (Even thought the examples on MSDN still show it being set.)
ImageStream / MaxImageSize
Previously this was a tiny 16kb and it made it impossible to show high quality images (of album artwork or packshots) at 358x358 (or 173x173) pixels.
Good news!
This has been dramatically increased to a much more practical 75kb.
Disappointingly this still isn't clearly documented in MSDN and the page on How to: Integrate with the Music and Videos Hub for Windows Phone (only lists the physical image dimensions, not the size on disk) and we have to rely on an exception to know what the limit is:
Also disappointingly, that page doesn't allow for community content. :(
I'm sure there's a good reason that not every page supports community content but it would be nice if they did because I'd add some useful information there is I could. I suspect more people would read that there than this here.
With the latest/mango update to Windows Phone 7 there are a couple of changes/improvements to note.
MediaHistoryItem.Source
This is property still exists and is still not used for anything but it no longer needs to be set. (Even thought the examples on MSDN still show it being set.)
ImageStream / MaxImageSize
Previously this was a tiny 16kb and it made it impossible to show high quality images (of album artwork or packshots) at 358x358 (or 173x173) pixels.
Good news!
This has been dramatically increased to a much more practical 75kb.
Disappointingly this still isn't clearly documented in MSDN and the page on How to: Integrate with the Music and Videos Hub for Windows Phone (only lists the physical image dimensions, not the size on disk) and we have to rely on an exception to know what the limit is:
Also disappointingly, that page doesn't allow for community content. :(
I'm sure there's a good reason that not every page supports community content but it would be nice if they did because I'd add some useful information there is I could. I suspect more people would read that there than this here.
Wednesday, August 24, 2011
#wp7dev NoDo Tools won't deploy to Pre-Mango phone after Zune upgrade to 4.8
This morning I had an issue where after updating the desktop Zune software to the new version (4.8) Visual Studio (running the NoDo development tools*) became unable to deploy or debug apps running on a phone. This was the case with a phone running a Nodo version (specifically 7.0.7392) and another phone running a pre-NoDo build.
Obviously, losing the ability to deploy to and test on an actual device was of concern. After a few worried minutes involving restarting the software (Zune & Visual Studio) and rebooting the phone we resolved this issue by rebooting the PC. Panic over.
Hopefully knowing that a reboot may be required may save someone else a bit of time.
* I have a separate machine running the Mango SDK RC which wasn't affected.
Obviously, losing the ability to deploy to and test on an actual device was of concern. After a few worried minutes involving restarting the software (Zune & Visual Studio) and rebooting the phone we resolved this issue by rebooting the PC. Panic over.
Hopefully knowing that a reboot may be required may save someone else a bit of time.
* I have a separate machine running the Mango SDK RC which wasn't affected.
Sunday, August 14, 2011
Catching an uncatchable exception
Recently we had an interesting issue in a Windows Phone 7 app I was working on that proved awkward to address. The code in question related to playing a video via the MediaPlayerLauncher.
The code in question looked like this:
"Not allowed to call Show() when a navigation is in progress"
As a first we tried wrapping the above code in a simple try..catch block to handle the unhandled exception:
Next we tried to determine if navigation was in progress by comparing the CurrentSource and Source properties of the page but that didn't work either.
Then I had an idea.
What if we split the separated the generation of the object and the calling of the method?:
I'm a big fan of not writing any code I don't have to and so having to write more than I think should be absolutely necessary here is a little bit disappointing. It's good to know, however that this isn't an exception I can't do anything about.
In this situation I can happily ignore this exception as if the user has hit back shortly after trying to lauch the video it's reasonable to assume they don't actually want to watch it.
The code in question looked like this:
new MediaPlayerLauncher { Media = fileUri }
.Show();
The issue we had was that if the user triggered the launching of the MediaPlayer and then very quickly hit the back button then they could get the following error.
"Not allowed to call Show() when a navigation is in progress"
As a first we tried wrapping the above code in a simple try..catch block to handle the unhandled exception:
try
{
new MediaPlayerLauncher { Media = fileUri }
.Show();
}
catch (Exception exc)
{
...
}
But this didn't work.
Next we tried to determine if navigation was in progress by comparing the CurrentSource and Source properties of the page but that didn't work either.
Then I had an idea.
What if we split the separated the generation of the object and the calling of the method?:
var mediaLauncher = new MediaPlayerLauncher();
mediaLauncher.Media = fileUri;
try
{
mediaLauncher.Show();
}
catch (InvalidOperationException exc)
{
...
}
This did allow us to catch and handle the exception. Yay!
I'm a big fan of not writing any code I don't have to and so having to write more than I think should be absolutely necessary here is a little bit disappointing. It's good to know, however that this isn't an exception I can't do anything about.
In this situation I can happily ignore this exception as if the user has hit back shortly after trying to lauch the video it's reasonable to assume they don't actually want to watch it.
Microsoft and me. A disclaimer
If you didn't know, I'm a freelance developer. If you're looking for someone to do some mobile development, particularly on Windows Phone 7, then please get in touch.
Recently I've been doing some work for Microsoft. They're keen that I make it clear that anything I say on this blog, or via my Twitter account (@mrlacey) is entirely my own thought, opinion, etc.
Nothing I say here is the opinions of anyone but myself.
As far as I am concerned there is no conflict of interest with my continuing to run the Windows Phone User Group and do a short term contract with Microsoft. The group continues to remain an independent group. If you have any concerns over this then please let me know.
Recently I've been doing some work for Microsoft. They're keen that I make it clear that anything I say on this blog, or via my Twitter account (@mrlacey) is entirely my own thought, opinion, etc.
Nothing I say here is the opinions of anyone but myself.
As far as I am concerned there is no conflict of interest with my continuing to run the Windows Phone User Group and do a short term contract with Microsoft. The group continues to remain an independent group. If you have any concerns over this then please let me know.
Wednesday, August 03, 2011
Getting version numbers and names right is hard
Rant alert! You have been warned!
Managing platform & SDK version names and numbers can be hard. When you want a simplified, public name for these that can be used in marketing and promotion things can easily get confusing.
Let's consider Windows Phone:
Once upon a time there was "Pocket PC"
Then there was "Smartphone" - before it became a generic term.
This was followed by "Windows Mobile"
When "Windows Mobile" (the OS) reached version 6.X it was marketed to the public as being "Windows Phone"
Then Microsoft announced "Windows Phone 7 Series"
This was quickly rebranded "Windows Phone 7"
This first major update to this was codenamed "mango"
When beta versions of the "mango" tool were made available to developers they were versioned as 7.1.
It's been reported that, when it's officially released, what has previously been "codenamed mango" will be version 7.5 and the platform as a whole will be referred to as simply "Windows Phone"
We're now in the position where names are being reused and there are multiple names and version numbers for the same thing. :(
If this wasn't potentially confusing enough some (hopefully well meaning) people have started retagging blogs, tweets, questions, etc. with their own personal preference for the name and sometimes version number.
In a folksonomy it's "folkS" plural!
If you're a single person, with limited, demonstrated, knowledge and experience of anything and you want to start changing what things are called (especially if it's something I care about) please don't. It doesn't make you clever or important and you coudl end up doing more harm than good.
It's also a waste of time to manually retag things when ways to create aliases exist.
Blindly changing things without addressing the reasons why they need changing or informing the people who are continuing to create items with the "older" tag just compounds problems and confusion.
Grrr
Managing platform & SDK version names and numbers can be hard. When you want a simplified, public name for these that can be used in marketing and promotion things can easily get confusing.
Let's consider Windows Phone:
Once upon a time there was "Pocket PC"
Then there was "Smartphone" - before it became a generic term.
This was followed by "Windows Mobile"
When "Windows Mobile" (the OS) reached version 6.X it was marketed to the public as being "Windows Phone"
Then Microsoft announced "Windows Phone 7 Series"
This was quickly rebranded "Windows Phone 7"
This first major update to this was codenamed "mango"
When beta versions of the "mango" tool were made available to developers they were versioned as 7.1.
It's been reported that, when it's officially released, what has previously been "codenamed mango" will be version 7.5 and the platform as a whole will be referred to as simply "Windows Phone"
We're now in the position where names are being reused and there are multiple names and version numbers for the same thing. :(
If this wasn't potentially confusing enough some (hopefully well meaning) people have started retagging blogs, tweets, questions, etc. with their own personal preference for the name and sometimes version number.
In a folksonomy it's "folkS" plural!
If you're a single person, with limited, demonstrated, knowledge and experience of anything and you want to start changing what things are called (especially if it's something I care about) please don't. It doesn't make you clever or important and you coudl end up doing more harm than good.
It's also a waste of time to manually retag things when ways to create aliases exist.
Blindly changing things without addressing the reasons why they need changing or informing the people who are continuing to create items with the "older" tag just compounds problems and confusion.
Grrr
Monday, July 11, 2011
To those who said I was certifiable...
... you were right!
It seems that a few other people on Twitter are reporting that they haven't received their results from taking the beta exam yet. As I received mine yesterday (I tend not to check email at the weekend) I'm guessing that results are being sent out slowly.
It seems that a few other people on Twitter are reporting that they haven't received their results from taking the beta exam yet. As I received mine yesterday (I tend not to check email at the weekend) I'm guessing that results are being sent out slowly.
Thursday, July 07, 2011
Creating a horizontally scrolling list #wp7dev
I recently needed to show someone how to make a ListBox scroll horizontally rather than vertically. Here's what I did:
The key part is: '<StackPanel Orientation="Horizontal" />'
It's this that controls the direction. of item display.
The next two parts give us the correct scrolling behaviour that we want.
Setting 'ScrollViewer.HorizontalScrollBarVisibility="Auto"' enables horizontal scrolling.
Setting 'ScrollViewer.VerticalScrollBarVisibility="Disabled"' prevents vertical scrolling.
The thing to note is that setting XxxxScrollBarVisibility doesn't just control the visibility if the scrollbar it also controls whether scrolling in that direction is possible.
The key part is: '<StackPanel Orientation="Horizontal" />'
It's this that controls the direction. of item display.
The next two parts give us the correct scrolling behaviour that we want.
Setting 'ScrollViewer.HorizontalScrollBarVisibility="Auto"' enables horizontal scrolling.
Setting 'ScrollViewer.VerticalScrollBarVisibility="Disabled"' prevents vertical scrolling.
The thing to note is that setting XxxxScrollBarVisibility doesn't just control the visibility if the scrollbar it also controls whether scrolling in that direction is possible.
Must have game: Sonic 4 Episode 1 (for WP7)
Disclaimer: This review is part of a shameless attempt to win fabulous prizes.
If I think back, it's with a slight sense of regret that I probably spent more time playing computer games than doing homework while I was at school. The vast majority of the time I wasted away was spent playing 4 games (or groups of games): Mario, Zelda, Tetris & Sonic.
I don't expect to ever see Mario or Zelda games on a Windows Phone (or XBox) and I've already got the 200 gamers points for Tetris on WP7. Fortunately now I can relive my mis-spent youth by spending far too much time playing Sonic.
It's games like this that make me stop and appreciate how far we've come with technology and just how powerful the phone in my pocket really is. I remember when graphics like this on a console were cutting edge and impressive.
While still looking good even now, the graphics aren't what this game is about though. Sonic is from the golden age of computer games when gameplay was everything! No gimmicks or throwing of animals. This is all about running (really fast) jumping on weird animal creatures and collecting rings. As computer games go, it doesn't get much better than this.
I'm not sure how this is the 4th part in the series as it seems like a rehash of levels from earlier versions of the app. That doesn't matter though it's a great way to relive my childhood and swap sleep for time spent with a speedy blue hedgehog.
Maybe in episode 2 Tails (that was the name of the fox-wasn't it?) will be back?
Get it from the marketplace now (trial available).
If I think back, it's with a slight sense of regret that I probably spent more time playing computer games than doing homework while I was at school. The vast majority of the time I wasted away was spent playing 4 games (or groups of games): Mario, Zelda, Tetris & Sonic.
I don't expect to ever see Mario or Zelda games on a Windows Phone (or XBox) and I've already got the 200 gamers points for Tetris on WP7. Fortunately now I can relive my mis-spent youth by spending far too much time playing Sonic.
It's games like this that make me stop and appreciate how far we've come with technology and just how powerful the phone in my pocket really is. I remember when graphics like this on a console were cutting edge and impressive.
While still looking good even now, the graphics aren't what this game is about though. Sonic is from the golden age of computer games when gameplay was everything! No gimmicks or throwing of animals. This is all about running (really fast) jumping on weird animal creatures and collecting rings. As computer games go, it doesn't get much better than this.
I'm not sure how this is the 4th part in the series as it seems like a rehash of levels from earlier versions of the app. That doesn't matter though it's a great way to relive my childhood and swap sleep for time spent with a speedy blue hedgehog.
Maybe in episode 2 Tails (that was the name of the fox-wasn't it?) will be back?
Get it from the marketplace now (trial available).
Do you want a .app domain for your app?
This is cross posted on the WPUG blog.
In 2012 ICANN will make the gTLD of .app available. As you can imagine, there is likely to be a lot of interest in controlling this due to the potential demand for such domains.
The .app project is a community funded and executed project to obtain rights to the .app gTLD:
So why should you care?
Well, if you ever think you might want a .app domain and don't want to have to pay huge amounts for it then you may benefit from offering your support now.
What can you do?
Head on over to the website and register you interest then follow them on twitter at @dotappapp.
In 2012 ICANN will make the gTLD of .app available. As you can imagine, there is likely to be a lot of interest in controlling this due to the potential demand for such domains.
The .app project is a community funded and executed project to obtain rights to the .app gTLD:
"We’re looking to gain support from the community together the funds necessary to build and operate the .app gTLD in perpetuity. Our aim is to keep the .app gTLD open and accessible such that it becomes an entity that properly support the mobile application software development community, particularly in areas of intellectual property protection."The project is currently looking to gain support and raise the necessary funds to run the gTLD.
So why should you care?
Well, if you ever think you might want a .app domain and don't want to have to pay huge amounts for it then you may benefit from offering your support now.
What can you do?
Head on over to the website and register you interest then follow them on twitter at @dotappapp.
Tuesday, June 21, 2011
yet more examples?
It's been suggested that I make more of this blog. One common suggestion is that I post some examples of how to do common tasks on Windows Phone 7.
There are already quite a few sites/blogs which do this. I'm a bit reluctant to be another "me too" and contribute more content which is little more than a rehash of content already on MSDN.
Sorry if that's a bit critical of some others.
What do you think?
What would you like me to write about?
There are already quite a few sites/blogs which do this. I'm a bit reluctant to be another "me too" and contribute more content which is little more than a rehash of content already on MSDN.
Sorry if that's a bit critical of some others.
What do you think?
What would you like me to write about?
Friday, June 17, 2011
XNAUK + WPUG = #DevChatUK (July 21st)

Come join both XNA-UK and WPUG for a mad bash twitter evening in a DevChat style Mashup on:
Thursday 21st July
7 – 9 PM UK time
#DevChatUK
We’re going to hijack the twitter hashtag #DevChatUK and do a wide scale Q&A / Chat session on all things Phone, XNA, Silverlight and Mobile development in general (including multi-platform questions)So come join in, publicise your current projects, lets us know who you are or just come and get info on what all this noise is about with online help from the experts in the field.
We recommend using a web service like http://tweetchat.com/ and enter the HashTag #DevChatUK to join in the fun.
Labels:
user groups,
Windows Phone 7,
wpug
Sunday, June 05, 2011
Book Review: 101 Windows Phone 7 apps - Volume 1: Developing apps 1-50
The prospect of a book with over 1100 pages long can seem a bit daunting. Considering this book is only volume 1 and only the first 50 apps it could seem even more so. The good news though is that this book is easy to read, thorough and full of up to date information.
The "unconventional" structure of the book where each chapter shows how to create a separate app is interesting and different but a lot of the apps created seem quite contrived and unuseful. Hopefully anyone reading this book will not end up creating their own versions of the apps that are in this book but will use the lessons it teaches to create their own apps which go beyond what's here and make something special.
A large reason for the size of the book is that all the code mentioned is printed in the book. Much of this seems unnecessary, especially as all the code is available for download.
Even though each chapter is focused on creating an individual app chapters build on each other so it really requires reading cover to cover. It then provides a useful reference for each feature which you can return to later but it does really require a full read first. This can be a bit much if you have some familiarity with Windows Phone 7 as a development platform.
Beyond the basic technical facts, this book provides numerous design and usability recommendations which are equally important for anyone getting started with developing apps for Windows Phone 7. These recommendations show a breadth and depth of experience and insider knowledge with WP7 and provide valuable pointers to anyone who is or wants to develop apps.
So what about the up to date information? The people I know who have written books say how long it takes. With that in mind I was impressed by the way that the book included information and details about the February update to the Silverlight Toolkit. (The book was published in April.)
I'm looking forward to volume 2 and the inevitable follow up with details about the new features and functionality coming in the mango update.
Disclaimer: I was given a free copy of this book but had been planning to buy it anyway. I'm still planning to buy the second volume.
Wednesday, June 01, 2011
TombstoneHelper V2.0 released #wp7dev
Great news - Version 2.0 of TombstoneHelper is now available from http://tombstonehelper.codeplex.com/
Actually it's been there for a fortnight, I've just been very slow to finish this post.
According to the change history it includes the following:
- A bunch of fixes
- Added the ability to limit the number of objects that should be saved. (This helps aid performance by not searching for other controls once it's found the ones you want to save.)
- Added support for ToggleSwitch
- Added horizontal scrollviewer offset support
- Added the ability to remember text entered in TextBoxes & Password boxes
- Added the ability to remember the control with focus
- Added the ability to remember the text selected within a TextBox (if appropriate)
- Added support for the Pivot control. (Be sure to name it!)
- Added the ability to specify the Types to tombstone through a generic interface. (Only up to 3 tyeps currently.)
- Added some basic extensibility support.
- Added support for the Panorama control via extensibility. (This was to demonstrate an extensibility implementation and to not add Panorama support by default as use of this isn't always desirable.)
If you have any questions or comments please add them in the comments here or in the discussions tab on codeplex.
For reference, the need to support Tombstoning doesn't go away with Mango but becomes less likely to be needed. One of the knock on effects is that it becomes harder to test tombstoning support in mango. I'm talking to the WP7 team about this and will duly report back.
I plan to continue to update and extend this library to make tombstoning easier through Mango. And beyond...
If you use and like it, please rate it on the NuGet site: http://nuget.org/List/Packages/WP7TombstoneHelper
Thursday, May 26, 2011
Simplifying use of SQL CE in Mango #WP7Dev (1 of n)
One of the features that the "Mango" tools introduce for Windows Phone development is a built in SQL Compact Edition (SQL CE) database. While learning about how to use it I was struck by how much better the experience could be.
As such, here is the first in what I hope will be a series of pointers and tips for making working with a database easier.
If you want to learn more about using SQL CE with Windows Phone codename "Mango" then I also recommend you check out the following on MSDN:
How to: Create a Basic Local Database Application for Windows Phone
and
Hands-On-Lab: Using local database in To-do application
When working with a database it's good practice to persist any changes to the datacache as quickly as possible. This means you'll probably end up doing something like this:
The only reason you may not want to do the above (Calling `SubmitChanges` after every call to `XxxxxOnSubmit()`) is if you were performing a number of insertions or deletions in a loop. In this case it may be wise (more performant) to call `SubmitChanges()` at the end.
When looking at even a short amount of code that does insertions or deletions it strikes me that there is a lot of duplication and that if those functions are always called together then it may make sense to bundle them up into a single function.
As it may not be immediately obvious how to do this (I had to explore a couple of options before I ended up with this), I present a simple class with some extension methods which does just that:
By using the above class, it means that where we were previously having to write 2 lines of code we can now just write 1 and still get the same functionality!
I hope this helps you write less code. (In a good way of course.)
Please let me know if you find this helpful.
As such, here is the first in what I hope will be a series of pointers and tips for making working with a database easier.
If you want to learn more about using SQL CE with Windows Phone codename "Mango" then I also recommend you check out the following on MSDN:
How to: Create a Basic Local Database Application for Windows Phone
and
Hands-On-Lab: Using local database in To-do application
When working with a database it's good practice to persist any changes to the datacache as quickly as possible. This means you'll probably end up doing something like this:
db.MyItems.InsertOnSubmit(myNewItemInstance); db.SubmitChanges();or this:
db.MyItems.DeleteOnSubmit(anItemInstance); db.SubmitChanges();quite a lot.
The only reason you may not want to do the above (Calling `SubmitChanges` after every call to `XxxxxOnSubmit()`) is if you were performing a number of insertions or deletions in a loop. In this case it may be wise (more performant) to call `SubmitChanges()` at the end.
When looking at even a short amount of code that does insertions or deletions it strikes me that there is a lot of duplication and that if those functions are always called together then it may make sense to bundle them up into a single function.
As it may not be immediately obvious how to do this (I had to explore a couple of options before I ended up with this), I present a simple class with some extension methods which does just that:
public static class TableExtensions
{
public static void InsertAndSubmitChanges(this Table table, T entity) where T : class
{
table.InsertOnSubmit(entity);
table.Context.SubmitChanges();
}
public static void DeleteAndSubmitChanges(this Table table, T entity) where T : class
{
table.DeleteOnSubmit(entity);
table.Context.SubmitChanges();
}
}
By using the above class, it means that where we were previously having to write 2 lines of code we can now just write 1 and still get the same functionality!
db.MyItems.InsertAndSubmitChanges(myNewItemInstance); db.MyItems.DeleteAndSubmitChanges(anItemInstance);
I hope this helps you write less code. (In a good way of course.)
Please let me know if you find this helpful.
Subscribe to:
Posts (Atom)









