Feeds

Microsoft nails Silverlight's future to Windows Phones

From three screens to one

Business security measures using SSL

PDC 2010 Microsoft is making it easier to write Silverlight apps for Windows Phones.

In the first half of 2011, Microsoft will deliver the Portable Library Project, which lets Silverlight programmers deploy apps for as many different types of devices as possible. It was released as a preview on Thursday.

The idea is to offer a single version of Silverlight than runs the same code across multiple devices – rather than build separate PC, browser, and phone versions of the platform.

On the PC and in the browser, Silverlight has officially given way to HTML5. But it is now Microsoft's official platform for building Windows Phone applications.

The problem is that Silverlight contains APIs that weren't necessarily built for phones, and there's no easy way for coders to work around this. Shawn Burke, a .NET developer director, promised PDC attendees on Thursday that the Portable Library Project "lets you avoid lowest common denominator syndrome, and lets you target a device in a natural way."

Burke was speaking during a session that was originally billed as a Silverlight talk, but at some point, it was re-named "three-screen coding: sharing code between Windows Phone, Silverlight, and .NET."

Before PDC, it was clear there was a political fight inside Microsoft over whether its strategy for web-based rich-media should favor Silverlight or HTML5. Silverlight was the star of last year's PDC. But since then, HTML5 has caught on, thanks in large part to the backing it received from Apple chief executive Steve Jobs.

During his Thursday keynote, Microsoft chief executive Steve Ballmer made it clear: HTML5 is the future strategy. The only mention of Silverlight was as a development environment and a runtime platform for Windows Phone 7.

Speaking later that day, Burke said the inspiration for the Portable Library Project was that people want to run their Silverlight applications on Windows Phone 7 - which uses parts of Silverlight 3 and 4.

But today, if you build a Silverlight app for the browser or the PC, it won't run unchanged on a Windows 7 Phone. That's because Silverlight contains APIs for the PC and the browser that just don't make sense on the phone - such as system.windows.browser and the Windows DOM APIs.

But if you take these APIs out of the Silverlight runtime, you deprecate the player, and fragmentation sets in.

Code portability has a mixed industry track record. You might get portability in JavaScript, for example, but you still need to know which browser you're targeting.

Some developers opt for assembly portability, targeting a small subset of system libraries to share business logic, validation code, file and protocol processors, and serialization. The project generates a common DLL and reference assemblies - sets of metadata used by the Intellisense feature in Visual Studio and during compilation of the app.

To make this happen, Burke's team devised something called a "portable core" that narrows the APIs that show up in Intellisense and uses reference assemblies to show what APIs work across selected the platforms.

The portable core contains a set of APIs that are common for Silverlight on a phone, browser, and PC - like string.compare. In the first release of Portable Library Project, you will get APIs for Basic BCL, Basic HTTP, and System.XML - what Burke called a starting point

Gone are APIs that are device-specific and not needed in the phone. So, there's no system.windows.browser or DOM APIs. Reflection.emit – an advanced feature for the dynamic creation of new types at runtime - has been removed because this doesn't work with the .NET Compact Framework on the phone. Serialization has been removed because Window Phone 7 can't do serialization. There's no file path. And there's no the Windows Communication Foundation, .NET Managed Extensibility Framework, or system.windows UI.

The goal is to add new functionality areas and expand the amount of portable code available in the core – and to let you target different types of devices. ®

New hybrid storage solutions

More from The Register

next story
'Windows 9' LEAK: Microsoft's playing catchup with Linux
Multiple desktops and live tiles in restored Start button star in new vids
Not appy with your Chromebook? Well now it can run Android apps
Google offers beta of tricky OS-inside-OS tech
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
iOS 8 release: WebGL now runs everywhere. Hurrah for 3D graphics!
HTML 5's pretty neat ... when your browser supports it
Greater dev access to iOS 8 will put us AT RISK from HACKERS
Knocking holes in Apple's walled garden could backfire, says securo-chap
NHS grows a NoSQL backbone and rips out its Oracle Spine
Open source? In the government? Ha ha! What, wait ...?
Google extends app refund window to two hours
You now have 120 minutes to finish that game instead of 15
Intel: Hey, enterprises, drop everything and DO HADOOP
Big Data analytics projected to run on more servers than any other app
SUSE Linux owner Attachmate gobbled by Micro Focus for $2.3bn
Merger will lead to mainframe and COBOL powerhouse
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
WIN a very cool portable ZX Spectrum
Win a one-off portable Spectrum built by legendary hardware hacker Ben Heck
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Security and trust: The backbone of doing business over the internet
Explores the current state of website security and the contributions Symantec is making to help organizations protect critical data and build trust with customers.