Test-drive HTML5 Development for Windows Phone & Desktop

It seems to be increasing said these days, that software solutions are moving away from the desktop and to the cloud and mobile space.  There’s more to be said about this which I’ll blog about soon, but let’s just agree that this leads to at one possible conclusion – we need to be able to develop sufficiently rich client-based solutions that run on both desktops and a wide variety of mobile devices that all connect to the cloud.  If we add the requirement that we want to reach as many users and devices as possible on the client-side, with a single ‘base’ of code (and we aren’t too fussy about immersive UI, richness of experience, deep access to local resources and to varying extents, and very high development productivity/maintainability), then we are often lead to the door of HTML.  With ‘HTML5’, we can even be fussy about a few things too.

Microsoft is making its platforms capable of running those HTML5 solutions.  Currently this means IE9 on the Windows desktop and now also IE9 on Windows Phone 7.5 (now RTM’d and due on phones this fall).  We’ll likely see more native platform support for HTML5 solutions in Windows 8 with IE10.  Given the right use of HTML of course, a solution for Windows desktop and phone, should also work on a large range of HTML5-compatible desktop browsers and mobile devices.

Here’s the same hardware-accelerated HTML5 content running on IE9 and Windows Phone Mango.

sidebyside

Getting started with HTML5 development on Windows

So what do you need?  On the desktop you can get IE9 and start ‘coding’ in something as simple as Notepad(!).  Use the free included F12 developer tools to explore and even debug your solution.  For something a little more productive, you can go for the free Visual Studio Web Developer 2010 Express SP1 largely for the HTML editor support and test web-server, plus you’ll want the community-based Web Standards Update for Microsoft Visual Studio SP1 for IntelliSense support.  For testing on Windows Phone, go to http://create.msdn.com to get the latest Windows Phone Tools/SDK (currently Windows Phone SDK 7.1 Beta 2) to be able to run the emulator on your machine which includes the mobile browser.  If you are not connecting to any web-based data services, or you are connecting to existing services, you may not need any other tools, but you’ll probably want the jQuery library to be more productive with your JavaScript.  Want some great slides on jQuery (from a Microsoft guy)?  Download Joe Marini’s Mix 2011 jQuery bootcamp slide deck.

Doing rich HTML5 stuff

The easiest way to learn about new HTML5 is to see some in action and check behind the scenes.  To demonstrate the great HTML5 and hardware-accelerated capabilities of IE9 on the Windows desktop and Windows Phone, Microsoft created two ‘testdrive’ sites.  They include some great and diverse examples as well as links to useful resources.

http://ie.microsoft.com/testdrive for IE9 on the desktop

ie9td

 

http://ie.microsoft.com/testdrive/mobile (which works on the phone and the desktop)

ie9wptd

Detecting desktop vs. mobile browsers

One of the key issues to tackle when creating an HTML5 application that will work on the desktop and on mobile, is getting the right layout experience for the screen size, ideally using the same markup.  CSS3 Media Queries are a great solution here.  The test site includes an example of this (see entry in screenshot above).  In addition I’d suggest watching this video from Mix 2011 as well as this blog entry from the Windows Phone team (by the same Joe Marini that did the jQuery bootcamp at Mix).

Dealing with down-level browsers/capabilities

Of course a good solution should deal gracefully with down-level browsers and missing HTML5 capabilities, especially given that the specification is still in flux.  On many existing websites, this is still handled on the server side by looking at the User Agent string provided by the browser application, and delivering browser-specific content.  In the new client-side world, it’s often better to detect the browser capabilities in the client code and enact progressive enhancements to the user experience based on what specific features the browser has.  If the browser cannot do some of the new HTML5 goodness, you may want to consider a ‘Polyfill’.  To help detect browser capabilities, there’s a library called Modernizr, and a number of Polyfills available to handle missing capabilities that Modernizr can detect.

I hope this has given you an idea of how you can start to test drive HTML5 experiences and development on the Windows desktop, upcoming Windows Phone 7.5/Mango phones and beyond on to other ‘HTML5-ready’ browses and devices.

Will you Get Fat and Poorer with New Electricity Time-of-use Rates?

I recently received the news that my electricity provider will be imposing time-of-use rates on my areas in 4 months.

This first came up 3 years ago and I blogged about it asking Will That New Electricity Meter Make you Poor and Fat?  It’s going to effect more and more people over time.  Let’s explore if I and perhaps you too, will end up paying more, or doing things to avoid paying more (like eating later at time) or working at home in more humid conditions during the summer…

That electricity meter was installed, has been feeding data to the electricity company – more on that in a moment – and they are ready to start complicating my bill.

Below is a chart showing the current rates (same all-day all-year, increasing after a level of consumption) vs. the new rates (changing over the day and the year).  It also shows how the rates and time-slicing has changed from the original proposals in 2008 to the rate that will go into effect in 2011.

  2008   2011  
Rate Type Rate (cents) per kWh When applies Rate (cents) per kWh When applies
Current 5 First 2000kWh 6.8 First 600kWh
Current 5.9 After 2000kWh 7.9 After 600kWh
Off-Peak 3 Mon-Fri 22:00 to 07:00 all-year
All weekends/holidays
5.9 Mon-Fri 19:00 to 07:00 summer/winter
All Weekends/Holidays
Mid-Peak 7 Mon-Fri 07:00 to 11:00 and 17:00 to 22:00 in the summer
Mon-Fri 11:00 to 17:00 and 20:00 to 22:00 in the winter
8.9 Mon-Fri 07:00 to 11:00 and 17:00 to 19:00 in the summer
Mon-Fri 11:00 to 17:00 in the winter
On-Peak 8.7 Mon-Fri 11:00 to 17:00 in the summer
Mon-Fri 07:00 to 11:00 and 17:00 to 22:00 in the winter
10.7 Mon-Fri 11:00 to 17:00 in the summer
Mon-Fri 07:00 to 11:00 and 17:00 to 19:00 in the winter

For the visually inclined – here’s how the new 2011 rates work in a pie-chart as published by the electricity company.

image

I few things to note:

  • Rates have obviously gone up a bit in 3 years – 36% on regular rates – as horrible as that is, let’s ignore that.
  • The break point for higher rates has come down from 2000kWh to 600kWh – so paying the higher rate more quickly – let’s ignore that too.
  • The average rate for a summer day on the new rates is 7.85c/kWh assuming constant rate of usage through the day.  This is higher than the current starting 6.8 rate and as high as the 7.9c/kWh rate.  Whether the real average rate is higher or lower for you, really depends therefore on your weekday daily-usage patterns.

The flyer includes the annoying statement: "In a 168-hour week, only 30 hours are at on-peak times.  There are three-times as many hours at off-peak periods."  This is annoying because, it’s of now benefit unless one can pick when the on-peak times are – the rates are most expensive at in-opportune moments for many – and it doesn’t mention that for 50% of week days (or 36% of the whole week), rates are now higher.

Let’s dig in to see what the consequences may be:

Some possible bill differences moving to the new rates for various power usage:

  • To cook dinner, now costs more during weekdays: 8.9c/kWh compared to 6.8c/kWh (if you haven’t used up the 600kWh), that is unless, you are prepared to cook after 7pm and eat even later (and potentially get fatter) or pre-cook much of your food during off-peak. However, realistically across the week and year that’s (say 2kW for 0.5 hour in an oven = 1kWh) 2.1c per day more x 125 days (summer) + 3.9c per day more x 125 days (winter) – 0.9c per day less x 100 days = $6.60 per annum more. That’s not so bad, but what else do I have running that will now cost more…
  • At one extreme – to operate air-conditioning at home (if you are at home during the day) now costs considerably more: 10.7c/kWh compared to 6.8c/kWh.  If the A/C is on 50% of the time (wild guess) from 7am to 7pm for 2 months at 3kW, that’s 3kWh hours at 2.1c more + 3kWh at 3.9c more x 5 days x 8 weeks = $7.20 more for the summer.  This doesn’t include the fan motor.
  • In middle may be things like using the dryer which could be more or less going forward depending on your schedule.
  • Anything that is a constant all-day, e.g. stuff-plugged in on standby, or the fridge, etc. is going to cost you more on average.  I use between 35kWh (winter) and 66kWh (summer) per day.

Real data check:

The new networked meter has been collecting data for a while and as a customer, I can go to the company’s website and check out my actual house usage.  So, we can actually see where the majority of my usage is, and therefore if my bill will be going up as a result of these new time-of-use rate on my existing household pattern…

They provide pie charts and bar graphs with numbers, but also exports to PDF & Excel. 

So for July so far, my average is: 7.4c/kWh which is higher than the current 6.8 (and a bit lower than the 7.9 for over 400kWh).

Off-Peak – 63%; Mid-Peak – 16%; On-Peak 21%

Extrapolating my online consumption of kWh the 21 days of July to 31 days and comparing the cost using my real average 7.4c rate to the cost with the current 6.8c (and 7.9c over 600kWh), I’d be paying $5 more in July under the new scheme.  My estimate of $7.20 more for 2 summer months of A/C didn’t look too shabby.. 

Conclusions:

  • So, with no change in usage, the new plan does costs me more ($5+ more a month in the summer), but considering that a gas-powered furnace fan doesn’t do much more work in the winter and there’s no A/C requirement, it’s not looking like like it’s going to be a huge amount more for the whole year – perhaps $50 a year more – well see.
  • Have A/C during the day?  You have to pay more to keep it the way you like it or turn down the thermostat to not pay more.
  • Cooking dinner? The cost of doing this before 7pm goes up so you have to eat later (potentially less healthy) or pre-cook cook during off-peak or pay a little more over the year.  
  • You will pay more over the year for all those 24-hours-a-day constant drain things you have plugged in.
  • You could end up going either way for things like using an electric clothes dryer, depending on when you end up doing those things.  If you already do a lot of this over night or on the weekend, and you don’t have A/C (or other major power draws) on much during the day, you may see your bill stay the same or go down.
  • Psychologically, I think some people may temporarily change their habits to avoid larger bills initially, but end up going back to their previous routine and paying a little more.

Picking a Hotel for the Build (Windows 8) Conference in September

Let me quickly share some mapping information for you that really should be on the Build registration site to help you make a decision on a hotel:

2011 build hotels

# Hotel Details US$ Rate per night + 17% tax
1 Anaheim Marriott
700 West Convention Way
Anaheim, CA 92802
714-750-8000
169
2 Anaheim Portofino Inn and Suites
1831 South Harbor Boulevard
Anaheim, CA 92802
714-782-7600
119
3 Coutyard by Marriott Anaheim
2045 S Harbor Blvd.
Anaheim, CA 92802
714-740-2645
135
4 Doubletree Guest Suites Anaheim Resort
2085 S Harbor Blvd.
Anaheim, CA 92802
714-750-3000
149
5 Hilton Anaheim
777 Convention Way
Anaheim, CA 92802
714-750-4321
159
6 Red Lion Hotel Anaheim
1850 S Harbor Blvd.
Anaheim, CA 92802
714-750-2801
119
7

Sheraton Park Hotel at the Anaheim Resort

1855 South Harbor Boulevard
Anaheim, CA 92802
714-750-1811

Note: Incorrect address on registration site

155

From 0 to Windows Phone ‘Mango’ in 1 Day at DevTeach

 

Next week will be an awesome week in Montreal.  DevTeach, the premier level-300/400 developer conference in Canada is on from Tuesday 31st to Thursday June 2nd.  This includes a complete additional MobileTeach track around Android, iPhone & Windows Phone. 

Not only that, but I’ll be running the 1-day post-conference training session on Friday dedicated to Windows Phone

This week Microsoft announced news about the upcoming Windows Phone ‘Mango’ release that really seals the deal on possibly the greatest smartphone user experience to date and enhances arguably the best mobile developer experience even further.

In this comprehensive 1-day post-conference for the agile mind, I’ll start by showing attendees (familiar with .NET), how to create a Silverlight application from scratch using the MVVM pattern (including advanced features like a templated items control and a custom panel), making design decisions for the phone and how to get an application published.  We’ll then dive into the platform features, figure out data access, sensors, location and notifications, conquer storage and tombstoning and wrap up with other new major Mango features.  Attendees will get access to samples.

Introduction

From 0 to published WP7 MVVM Silverlight app including:

  • Development Tools
  • Silverlight Development
  • MVVM
  • Data Binding
  • Timers
  • ItemsControl
  • Custom Layout Panel
  • DataTemplates
  • Phone UI Design
  • Marketplace policies

Accessing device features including:

  • Input
  • Shell Integration
  • Sensors
  • Location

Getting data and notifications from the cloud including:

  • Data Access
  • Building Phone-compatible Services
  • Notification Services

Application Lifecycle & Tomb-stoning

Local Data Storage (including isolated storage, 3rd party and Mango options)

Other new major ‘Mango’ features

You can add on that extra bumper day to the 3-day main conference price at a discount or purchase direct 1-day access for $399.

As if that’s not enough, I’ll also be doing a demo in the conference keynote and a session on Silverlight 5 features in the conference Silverlight track (which I also lead).

Hope to see you there!

Built on Silverlight & Azure: A Solution to Plan, Deploy & Track Your Workforce

During a trip to Redmond this year, I got to meet the Gu.  If you don’t know who that is, then never mind, but keep reading.  Anyway, another guy from Canada got to present alongside Scott (still don’t know who I’m talking about?) last November during the keynote for the Silverlight Firestarter event (when Silverlight 5 features were first publically announced).  That guy was David Ossip, CEO of Dayforce, demonstrating their latest Dayforce Workforce Management solution.

image

I’d seen the Firestarter demo, but I recently learnt about another aspect of this solution.  It would be reason enough to mention Dayforce because they use Silverlight for a rich client-powered experience.  Another reason to mention it, is that it also uses Windows Azure, a technology for which I have created and delivered training at Microsoft’s request.  The Windows Azure Platform is both an awesome platform and service for high availability and scalability and easy provisioning in the cloud or in a hybrid combination with on-premise system.

Dayforce epitomizes the kind of offering that is well suited to the platform.  They wanted to provide solutions that demanded zero IT maintenance for their customers and a scalable path as their customer base grew – they now have around 40 customers with some 150,000+ users.  Using Azure, adding more customers or users now involves merely deploying more Windows Azure instances with a few mouse clicks, rather than buying/licensing, racking/provisioning and adminstering servers.  Hosting the application on Windows Azure hosted services means running the services in an IIS environment that is great for hosting WCF-based services to which their rich Silverlight client can connect.  It’s a SaaS solution with a rich-client plus! 

This kind of Silverlight-Azure combo is the kind of thing I expect to see in droves with other successful offerings in the future.  Since Scott Guthrie is moving over to be a VP for the Azure platform, this awesome-sauce (hi John!) combination will no doubt get even better.

 

Want to know more about Dayforce?

About Dayforce – Dayforce offers a complete workforce management solution with functionality that includes time and attendance, labor scheduling, labor forecasting, labor budgeting, task management and employee self-service. The company has made waves in workforce management with a vastly superior user experience, a much faster application, and significantly greater business value.
In addition to being named one of Deloitte’s Companies-to-Watch, Dayforce has been named the winner of the Top HR Product of the Year by Human Resource Executive® magazine, the winner of the Microsoft BlueSky Award for Innovation Excellence, and one of the CIX Top 20 Innovative Companies. For more information, please visit www.dayforce.com.

Microsoft Regional Directorship

It’s probably about time for me to announce that I am now a Microsoft Regional Director.  The logo has been on the side there for a little while.

Let’s do the FAQ thing…

So you’ve been hired by Microsoft? No.

You’re an MVP.  So this is another award like that? No.

Is it something like a Microsoft Certification? No.

 

Teasing pause.  Being a Regional Director is a role, external to Microsoft, but working closely with Microsoft, that Microsoft invites select external people to undertake under contract.

 

How much does the role pay? Nothing.

Do you get any specific benefits? "… working closely [very closely] with Microsoft… " at many levels,  a presence on http://theregion.com, various other invitations, offers and program awards, and working with fellow program members.

How many RDs are there in the world? Right now, a little over 125 (see http://theregion.com) and the program has been around for many years.

Can I apply to be one? No.  You have to be invited.  Start by getting to know your local Microsoft Evangelist/Advisors.

What are the attributes of someone invited to become an RD.

From http://theregion.com (the official site for RDs)

Regional Directors are members of an elite, worldwide group of technology thought-leaders known for their national and international speaking tours, their authorship of books, articles and blogs, and their business acumen. Regional Directors are well-versed on the totality of the software industry. They are recognized for their achievements in communicating the benefits of emerging technologies.

and further qualification…

RDs are seldom specialized around a single [can be multiple] technology, but rather are well-versed on the totality of the software industry. Regional Directors have a strong affinity for emerging technology and are known to be early adopters of Microsoft products and technologies. Around the globe, RDs provide strategic technical direction for their business community.

So what tasks does the ‘role’ entail?

RDs start by working their regular day to day careers with employers or customers.  On top of that, or in the course of doing that, they evangelize Microsoft technologies and products through various channels, either of their own volition or sometimes at Microsoft’s request.  This may involving blogging (duh!) or other communication mediums, tweeting, meeting with customers, speaking at events, attending conferences, meeting with Microsoft teams and executives Winking smile, and advising companies or other institutions, etc.  RDs also bring valuable and trusted community and industry insight back to Microsoft.

 

In the last couple of monthly, I’ve been extremely busy lately with work and RD/MVP stuff.  I have a few blog series coming up around WP7, HTML5 & Silverlight, onto which you may want to keep an RSS reader tuned…

What’s Coming for WP7 developers in Mango

Blogged from the Microsoft Mix 11 Day 2 Keynote in Las Vegas

On day 2 of Microsoft’s Mix 11 conference, they explain how they will (in May) be “Delivering happiness” to Windows Phone developers. New Windows Phone end-user features will be announced at a later date.

Opportunity

Ecosystem

· Nokia will be bringing mobile billing expertise

Countries

· 16 more languages

· Developers in 38 (up from 30) countries can register to publish applications

· Phone users in 35 (up from 16) countries will be able to purchase apps

Discoverability

· New Program list – has the ‘long list’ initial letter jump buttons, a search button (inc. access to marketplace search in the results)

· Marketplace – Separates Apps, music, & Podcasts (US this fall)) and shows more details in list with publisher/price/rating

· Marketplace App page has a pivot: details, reviews, screenshots, related

· One-click install for free apps

· Auto-nav to apps list after install

· Search Extras – A Bing Search result can have extras deep linking into an app

Capability

Browser

· Browser uses same IE9 code-base for HTML5, JavaScript, CSS3

· Address bar at the bottom

· Background audio for HTML5 in browser (use phone controls too)

· H.264 video in video tag in full screen with controls

Phone integration

· Sockets

· SQL CE Database with ORM and Linq to SQL

· More launchers & choosers (inc. deep link to directions)

· Better access to contacts and calendar

· Pin to start of application deep links

· Raw camera access

· Access to compass

· Access to gyro (new optional hardware coming this year)

· Motion Sensor API (for ease of using compass and gyro)

· Ringtone API

Multi-tasking:

· Fast app switching – apps are suspending, and only terminated if necessary

· Background audio from apps (leveraging the standard phone media controls)

· Background downloads

· Setup alarms

· Live tile updating including animations

· “Live agents” occasionally run by a battery friendly scheduler (with user control of which ones can run this way) – gets events and can get location

Dev Experience:

New emulator features for Accelerometer (with 3D model of position) and location (with Bing maps input)

Performance improvement (for list)

· Scrolling and input

· Image decode

· Garbage collector (no pausing)

· Memory usage

Built on Silverlight 4 including RichTextBox

Local Database using SQL CE with ORM and LINQ to SQL

Can compose UI with Silverlight and XNA

Profiler (still free)