Tag Archives: silverlight

Microsoft wrestles with HTML5 vs Silverlight futures

Former Microsoft Silverlight Product Manager Scott Barnes has posted a series of tweets following a visit to Microsoft:

So.. after a week in Microsoft HQ etc.. i have a lot of inside info that just basically puts into question the future of #Silverlight #wpf

he remarks, and then:

Right now there’s a faction war inside Microsoft over HTML5 vs Silverlight. oh and WPF is dead.. i mean..it kind of was..but now.. funeral.

Barnes positions it as a fight between Windows/IE9 backing HTML5, and the developer division backing Silverlight. He also suggests that Microsoft is contemplating a classic “Embrace and extend” strategy for HTML:

HTML5 is the replacement for WPF.. IE team want to fork the HTML5 spec by bolting on custom windows APi’s via JS/HTML5

He says further that Microsoft has “shut down the designer story” – I am not sure what that implies, though I can imagine that a lot of money has been sunk into the Expression tools without drawing significant market share from Adobe’s Creative Suite.

Barnes is a straight-talking guy but clearly this is all speculation. Nevertheless it is obvious that, on the eve of launching IE9 beta with its fast JavaScript engine, hardware accelerated graphics, and pixel-precise bitmap drawing, Microsoft has a tricky job positioning HTML5 vs Silverlight. For that matter, even positioning Silverlight vs desktop Windows Presentation Foundation is not easy.

Since we are also on the eve of launch for Windows Phone 7, which Microsoft has flagged as a strategic product and which uses Silverlight as its app platform, it seems unlikely that the technology will be sidelined; but rumours of internal divisions on the subject do not surprise me.

Decompiling Silverlight

A Silverlight application is a .NET application. Most developers will be aware of this; but it is worth noting that whereas ASP.NET code executes on the server and is not normally available for download, Silverlight code is downloaded to the client and can easily be decompiled. It is almost as easy to view as JavaScript code in the browser.

If you want to investigate this, the first thing to do is to find the .xap file which contains the Silverlight application. You will likely find this in your browser cache, or you can download it directly from the web site hosting the application. If you have out-of-browser Silverlight apps, they are usually located at:

C:\Users\[username]\AppData\LocalLow\Microsoft\Silverlight\OutOfBrowser

Copy the .xap file somewhere convenient, and rename it to have a .zip extension. Then extract the files. The result looks something like this:

image

Next, you need a .NET decompiler such as Redgate .NET Reflector. Run Reflector and open a .dll file containing application code. Select a method, and Reflector does its best to show you the code. It does a good job too:

image

The purpose of this post is not to encourage decompiling other people’s code, but rather to make the point that even though Silverlight code is “compiled”, it is trivial to read it – just in case anyone thought it was a bright idea to store passwords or other authentication secrets there.

The solution is to never to put anything security-critical in client-side code. Second, you can use an obsfuscator such as dotfuscator to make the decompiled code harder to read.

Silverlight versus HTML, Flash – Microsoft defends its role

Microsoft’s Brad Becker, Director of Product Management for Developer Platforms, has defended the role of Silverlight in the HTML 5 era. Arguing that it is natural for HTML to acquire some of the features previously provided by plug-ins – “because some of these features are so pervasive on the web that they are seen by users as fundamentally expected capabilities” – he goes on to identify three areas where Silverlight remains necessary. These are “premium” multimedia which merges video with application elements such as conferencing, picture in picture, DRM, analytics; consumers apps and games; and finally business/enterprise apps.

It is the last of these which interests me most. Becker’s statements come soon after the preview of Visual Studio LightSwitch, which is solely designed for data-driven business applications. Taking the two together, and bearing in mind that apps may run on the desktop as well as in browser, Silverlight is now encroaching on the territory which used to belong to Windows applications. With LightSwitch in particular, Microsoft is encouraging developers who might previously have built an app in Access or Visual Basic to consider Silverlight instead.

Why? Isn’t Microsoft better off if developers stick to Windows-only applications?

In one sense it is, as it gets the Windows lock-in – and yes, this is effective. I’m aware of businesses who are tied to Windows because of apps that they use, who might otherwise consider Macs for all or some of their business desktops. On the other hand, even Microsoft can see the direction in which we are travelling – cloud, mobile, diverse clients – and that Silverlight fits better with this model than Windows-only desktop clients.

Another consideration is that setup and deployment issues remain a pain-point for Windows apps. One issue is when it goes wrong, and Windows requires skilled surgery to get some app installed and working. Another issue is the constant energy drain of getting new computers and having to provision them with the apps you need. Microsoft has improved this no end for larger organisations, with standard system images and centralised application deployment, but Silverlight is still a welcome simplification; provided that the runtime is installed, it is pretty much the web model – just navigate to the URL and the app is there, right-click if you want to run on the desktop.

If Microsoft can also establish Windows Phone 7, which uses Silverlight as the runtime for custom apps, the platform then extends to mobile as well as desktop and browser.

The downside is that Silverlight apps have fewer capabilities than native Windows apps. Printing is tricky, for example, though Becker refers to “Virtualized printing” and I am not sure what exactly he means. He also highlights COM automation and group policy management, features that only work on Windows and which undermine Silverlight’s cross-platform promise. That said, via COM automation Silverlight has full access to the local machine giving developers a way of overcoming any limitations if they are willing to abandon cross-platform and browser-hosted deployment.

A winning strategy? Well, at least it is one that makes sense in the cloud era. On the other hand, Microsoft faces substantial difficulties in establishing Silverlight as a mainstream development platform. One is that Adobe was there first with Flash, which has a more widely deployed runtime, works on Android and soon other mobile devices, and is supported by the advanced design tools in Creative Suite. Another is the Apple factor, the popular iPhone and iPad devices which are a spear through the heart of cross-platform runtimes like Silverlight and Flash.

Finally, even within the Microsoft development community Silverlight is a hard sell for many developers. Some us recall how hard the company had to work to persuade Visual Basic 6 developers to move to .NET. The reason was not just stubborn individuals who dislike change – though there was certainly some of that – but also existing investment in code that could not easily be migrated. Both factors also apply to Silverlight. Further, it is a constrained platform, which means developers have to live with certain limitations. It is also managed code only, whereas some of the best developers for both desktop and mobile apps work in C/C++.

I suspect there is division even within Microsoft with regard to Silverlight. Clearly it has wide support and is considered a strategic area of development. At the same time, it is not helpful to the Windows team who will want to see apps that take advantage of new features in Windows 7 and beyond.

Yesterday Windows Phone 7 was released to manufacturing, which means the software is done. Another piece of the Silverlight platform is in place; and I guess over the next year or two we will see the extent to which Microsoft can make it a success.

Dysfunctional Microsoft?

Microsoft watchers have been scrutinising the fascinating Mini-Microsoft post on the Kin smartphone debacle and what it says about the company. If it is even slightly accurate, it is pretty bad; and it must be somewhat accurate since we know that the hopeless Kin launch happened and that the product was killed shortly afterwards. Of course it would have been better to kill the project before rather than after the launch; the negative PR impact has affected the strategically important Windows Phone 7 launch.

Handsome profits from Windows and Office have enabled Microsoft to survive and even prosper despite mistakes like Kin, or the Xbox 360 “red ring of death”, or the Vista reset and related problems – mistakes on a scale that would sink many companies.

I see frequent complaints about excessively bureaucratic management with too many layers, and a tendency towards perplexing, ineffective but expensive advertising campaigns.

There are also questions about CEO Steve Ballmer’s suitability for the task. He nearly indulged in a disastrously over-priced takeover of Yahoo, saved only by the obstinacy of the target company’s leadership. He habitually dismisses the competition, such as Apple’s iPhone, and is proved wrong by the market. He failed to see the importance of cloud computing, and even now that the company is at least partially converted he does not set the right tone on the subject. I watched his keynote at the Worldwide Partner Conference (WPC) where he sounded as if he were trying unsuccessfully to imitate Salesforce CEO Marc Benioff from ten years’ ago. Microsoft needs to present a nuanced message about its cloud initiative, not someone shouting “oh cloud oh cloud oh cloud”.

Microsoft is also copying its competition as never before. Bing has a few innovations, but is essentially a recognition that Google got it right and an attempt to muscle in with a copy of its business model – search, advertising and data mining. Windows Phone 7 occupies a similar position with respect to Apple’s iPhone and App Store. Windows 8 also seems to borrow ideas from Apple.

Nevertheless, Microsoft is not yet a dying company, and it would be a mistake to base too much analysis of the company on something like comments to Mini-Microsoft’s blog – good though it is – since it is a magnet for disaffected employees.

While Ballmer’s effort at the WPC was poor, he was followed by Bob Muglia, president of server and tools, who was excellent. Windows Azure has come on remarkably since its half-hearted preview at PDC 2008; and Muglia comes over as someone who knows what he is trying to achieve and how he intends to get there. The Azure “Appliance” idea, shipping a pre-baked cloud infrastructure to Enterprise customers, is a clever way to exploit the demand for a cloud application model but on hardware owned by the customer.

The eBay announcement at WPC was also quite a coup. eBay will “incorporate the Windows Azure platform appliance into two of its datacenters” later this year; and while it is not clear exactly how much of eBay will run on Azure, these appliance kits represent significant hardware.

We’ve seen other strong releases from Microsoft – server 2008 R2, Exchange 2010, SQL Server 2008 R2, SharePoint 2010 which whatever you think of SharePoint is a solid advance on its predecessor, and of course Windows 7 which has done a lot to rescue Microsoft’s performance and reputation after the Vista disappointment.

I also continue to be impressed by Visual Studio 2010, which is a huge release and works pretty well in my experience.

What about Windows Phone 7? With the market focused on iPhone vs Android, clearly it is in a tough market. If there is something slightly wrong with it on launch, instability or some serious hardware or software flaw, it might never recover. Nevertheless, I do not write it off. I think the design effort is intelligent and focused, and that the Silverlight/XNA/.NET development platform along with Visual Studio is an attractive one, especially for Microsoft Platform developers. VP Scott Guthrie describes the latest SDK here. People still switch phones frequently – something I dislike from an environmental point of view, but which works in favour of new entrants to the market. If Windows Phone 7 is a decent device, it can succeed; I’d rate its long-term chances ahead of HP WebOS, for example, and will be keen to try it when it becomes available.

phonedev

Is there a lot wrong with Microsoft? Yes. Does it need a fresh approach at the very top? Probably. Nevertheless, parts of the company still seem to deliver; and even the Windows Phone 7 team could be among them.

PivotViewer comes to SilverLight – data as visual collections

Microsoft has released a PivotViewer control for Silverlight. Data visualisation is a key business reason to use Silverlight or Flash rather than HTML and JavaScript for an application, so it is a significant release. But what does it do?

PivotViewer is the latest tool to come out of the Microsoft Live Labs Pivot project. Pivot is based on collections, which are sets of data where each item has an associated image. A pivot item has attributes, similar to properties, called facets; and facets have facet categories. Facet categories are used to filter and sort the data.

More complex Pivot data sets have several linked collections, or dynamic collections which are generated at runtime as a query result. This is necessary if the size of the data set is very large or even unbounded. You could create a web search, for example, that returned a pivot collection.

Once you have created and hosted your Pivot collections, most of the work of displaying them is done by the Pivot client. There is a desktop Pivot client, which is Windows-only; but the Silverlight PivotViewer is more useful since it allows a Pivot collection to be viewed in a web page. The client (or control) does most of the work of displaying, filtering and sorting your data, including a user-friendly filter panel.

PivotViewer also makes use of Deep Zoom, also known as Seadragon, which lets you view vast images over the internet while downloading only what is needed for the small section or thumbnail preview you are viewing.

The result is that a developer like Azure Technical Strategist Steve Marx was able to create a PivotViewer for Netflix with only about around 500 lines of code. This kind of product selection is a natural fit for Pivot.

I was quickly able to find the highest-rated music movies in the Netflix Instant Watch collection.

image

Starting with the full set, I checked Music and Musicals and then set Rating to 4 or over.

 

image

It seems to me that the strength of Pivot is not so much that it offers previously unavailable ways to visualise data, but more that it transforms a complex programming task into something that any developer can accomplish. Microsoft at its best; though of course it will only work on platforms where Silverlight runs.

Big browser and RIA news: Canvas comes to Internet Explorer 9

I’ve just installed the third Internet Explorer Platform Preview (on a virtual machine just in case) and run through a few of the demos. One of the most impressive is Canvas Pad, which demonstrates the HTML 5 Canvas element.

image

Canvas is particularly interesting, since it provides a surface to which you can draw anything you like. Canvas support was not announced at Mix earlier this year, when IE9 was unveiled, and some of us speculated that Microsoft would omit it in order to preserve the value of its Silverlight plugin – though in doing so it would also help Adobe Flash. Well, apparently the IE9 team decided to risk it. Not only is canvas supported; it is also hardware-accelerated:

Like all of the graphics in IE9, canvas is hardware accelerated through Windows and the GPU. Hardware accelerated canvas support in IE9 illustrates the power of native HTML5 in a browser.

Is there still value in Silverlight and Flash? There is, for several reasons. A plug-in presents a predictable runtime, insulating the application from browser variations. A plugin will work on browsers that do not yet support Canvas. Further, Silverlight includes the .NET Framework with its rich library, and supports the .NET languages, whereas for HTML5 you have to use JavaScript – though don’t forget Google Web Toolkit, which compiles Java to JavaScript, and other similar projects.

Even so, once you have hardware-accelerated Canvas there will be few occasions when you absolutely have to use Flash, Silverlight or Java.

Microsoft is doing the right thing. Crippling IE for the sake of Silverlight would only push users to other browsers, so it would not achieve its goal.

A full list of what is new in IE9 is here. It is shaping up to be the most interesting new IE since version 4.0 back in 1997.

Native code interop in Adobe AIR vs Microsoft Silverlight

The latest versions of Adobe AIR and Microsoft Silverlight both allow access to native code, but with limitations. The two platforms take a different approach though – here is a quick comparison.

Native code access in AIR

The new version 2.0 of Adobe AIR is just about done. The runtime is available now (as is Flash Player 10.1), but we have to wait until June 15 for the final version of the SDK.

AIR lets you create cross-platform desktop applications that use the Flash runtime. Supported operating systems include Mac, Windows and Linux, and coming soon, Android. Sadly, supported operating systems do not include Apple’s iPhone or iPad.

One of the big new features in AIR 2.0 is access to native code. Of course this breaks cross-platform, unless you create identical native code extensions for all the platforms that AIR supports. Still, the ability to extend AIR without limit using native code is significant. So how do you use it, can you call a DLL or a dynamic shared library? What about COM on Windows, for automating Microsoft Office?

The answer is that you can do all these things, but not easily. There are actually three obvious ways to communicate with native applications in AIR 2.0:

1. Open a document using the default file handler. This is done using the new openWithDefaultApplication function. This is a handy way to open a PDF or Microsoft Office document, but you as the developer have little control over what happens. You do not know which application will open, and cannot control it once it does open.

2. Socket support. Your AIR application can send and receive data over a TCP socket. If you write a native code socket server and install it, you can get access to the local operating system APIs that way.

3. Native process support. This one looks promising. The new NativeProcess class lets you launch a native application and communicate with it via STDIN and STDOUT. Your native application could do anything, of course, such as calling a DLL or using COM, but it must use STDIN and STDOUT to communicate with AIR.

Another limitation is that AIR applications which use this function must be installed with a native installer, rather than by downloading an .AIR file. A further limitation is that auto-update does not work for these applications. You will have to write your own code to check for updates and download an updated installer if necessary.

Native code access in Silverlight

Microsoft Silverlight 4.0 also has the ability to run on the desktop and to call native code – but the native code part only works on Windows, and is restricted to applications that are “Trusted”, which means the user has approved the installation. A trusted Silverlight 4.0 desktop application can call COM via AutomationFactory.CreateObject. Presuming it is successful, your application can call methods on the returned object. If what you really want is to call a DLL, for example, you would have to write a COM DLL (or an application with a COM API) that calls the native DLL.

In addition, Silverlight 4.0 trusted applications have socket support, so that would be another possible approach. However, unlike Adobe AIR 2.0, you cannot simply open a document using the default file handler for its type. That said, it would be trivial to do so using COM and the WScript object, for example. You can also use the browser to do this – see here for an interesting case study from Beat Kiener, who does this with remote documents.

The main limitation of native code access in Silverlight is that it only works on Windows. Even if it does go cross-platform at some point, you would not use COM on Mac or Linux, so some other mechanism will be necessary.

Comparing the two

First, let’s acknowledge that native code interop is not something to use lightly in a cross-platform runtime. If you have to use native code, maybe AIR or Silverlight is not the right choice.

Opening files using the default file handler is a different case, as you can do this without any platform-specific code.

Still, if you can do almost everything in AIR or Silverlight, but need to call a native API for just one or two important features, it may be a reasonable approach.

My immediate observation is that native code interop is easier in Silverlight, though wrecked by being restricted to Windows only. The packaging and updating limitations in AIR, plus being restricted to STDIN and STDOUT, is more arduous than using COM in Silverlight.

Further, it is a shame that neither platform lets you simply call a dynamic library. It would then be relatively easy to write some conditional code to load the appropriate library on different platforms, and many tasks could be accomplished without needing to build and deploy your own native code executable for each platform.

Will you be using native code interop in either AIR or Silverlight? I’d be interested in hearing of examples, and how well it is working for you.

Steve Ballmer and Ray Ozzie at All things Digital – a poor performance

Microsoft CEO Steve Ballmer and Chief Software Architect Ray Ozzie put on a poor performance when quizzed by Walt Mossberg at the All Things Digital conference, judging by Ina Fried’s live blog.

What was wrong with it? They allowed the conversation to be focused mainly on competing products: Apple iPad, Google Android, Google Apps, Google search. Since these products have exposed weaknesses in Microsoft’s own offerings, it was unlikely to work out well.

Mossberg asks about the transition to the cloud. “You guys are putting, for instance, a version of Office in the cloud.”

That was a gift. You would expect the two men to enthuse about how Microsoft’s dominance with desktop Office was now including the cloud as well, how the Office Web Apps enable new opportunities for collaboration, how Microsoft’s investment in XML for Office was now enabling the same document to live both on the desktop and in the cloud.

Nope. Ozzie waffles about people being more connected. Ballmer “disputes the notion that everything is moving to the cloud”.

So what about Steve Jobs prediction, of a transition from PCs to tablets and mobile devices? Ballmer says “not everyone can afford five devices,” lending support to the notion that Windows is for those who cannot afford something better.

Mossberg asks about tablets. Although Mossberg did not say so explicitly, tablets have been a tragi-comedy at Microsoft. Bill Gates evangelised the tablet concept years ago, pre-echoing Jobs’ claim that they would largely replace laptops. Microsoft tried again and again, with XP Tablet Edition, Vista on tablets, then “Origami”, or Ultra-mobile PC. Going back even further there were was the stylus-driven Palm-size PC (I have one in the loft). Tablet PC was not a complete failure, but remained an expensive niche. Origami sank without trace.

Ballmer replied that the “race is on”. Meaning? I guess, now that Apple has demonstrated how to make a successful Tablet, Microsoft will copy it? Or what?

I am not sure how you defend such a poor track record; but the starting point would be to explain that Microsoft has learned from past mistakes. In some ways it has; Windows 7 learns from mistakes in Vista, and Windows Phone 7 learns from mistakes in Windows Mobile.

None of that from Ballmer, who says vaguely that he expects Windows to run on a variety of devices. He makes matters worse later, by defending the stylus. “A lot of people are going to want a stylus,” he says. Some do, perhaps, but Apple has pretty much proved that most people prefer not to have one. I’d like to see effort go into designing away the need for a stylus, rather than implying that Microsoft is just going to repeat its part mistakes.

Someone in the audience asks, “Will we see Silverlight on Android or iPhone?” “My guess is  if it did, it would be blocked”, says Ballmer, ignoring the Android part of the question.

He’s ignoring the force of the question. Why bother developing for Silverlight, if it is locked into a Microsoft-only future, especially considering the company’s poor position in mobile currently? Ballmer could have mentioned the Nokia Symbian port. He could have said how Microsoft would get it on iPhone just as soon as Apple would allow it. He could have said that Microsoft is working with Google on an Android port – I don’t know if it is, but certainly it should be. He could have said that Silverlight plus Visual Studio plus Microsoft’s server applications is a great platform that extends beyond Windows-only clients.

Microsoft does have problems; but it also has strong assets. However it is doing an exceptionally poor job of communicating its strengths.

Update: There is a fuller transcript at Engadget, in which Ballmer and Ozzie come over better, though they still fail to impress. On mobile though, I like this comment:

We have new talent, we had to do some cleanup, we did it for Windows, and we’re doing it for mobile. And excellence in execution is also part of the equation.

I’d be interested in hearing from anyone present at the event.

What is happening with Silverlight on Intel Moblin/Meego?

Last September, Microsoft and Intel announced a port of Silverlight to Moblin Linux. I posted on the subject here, including a quote from Microsoft’s Brian Goldfarb:

Microsoft and Intel announced today that the two companies have agreed to work together to bring support for Silverlight 3 to Intel’s Atom-based Mobile Internet Devices (MID). These Atom-based devices run on Windows and Moblin, an open source, Linux-based operating system targeted at Atom-based devices. In order to help bring Silverlight content to these devices, Microsoft has provided Intel with Silverlight source code and test suites, and Intel will provide Microsoft with an optimized version of Silverlight for Moblin devices that Microsoft can then redistribute to OEMs.

Since then, Moblin has merged with Novell’s Maemo to form MeeGo (though this is still work in progress), and we’ve heard very, very little about Silverlight on either platform. The only snippet of news I have is that it was mentioned at the Intel Developer Forum in Beijing and reported by Char Zvolanek, who said that it came up in the Meego Q&A after regular sessions ended, and Silverlight will be supported in Meego  version 1.1 in October:

In May, the 1.0 version will be released, and with 1.1 coming out in October, there will be support for Silverlight, Java, and Air. Developers can write native or runtime apps that can be Java-based, Web-based, Silverlight-based, or Air-based.

Today, another clue, but not a good one for Silverlight. Intel is holding an application lab on May 26th in San Jose, for developing for the Intel AppUp store, either on Windows or Moblin. On the agenda: C/C++ and Adobe AIR, and the upcoming Adobe AIR SDK for Moblin. No Silverlight.

If anyone is going along, and can discover any news about Silverlight on Moblin, I’d be interested to know.

A business web site implemented entirely in Silverlight

Ever wondered what the web would look like if Silverlight or Flash were used for everything? The other day I came across a business site implemented entirely in Silverlight – well, apart from the forums, which seem to be HTML and JavaScript. ForefrontSecurity.org is a third-party resource site for Microsoft’s firewall and server security products. It is mostly documents and videos.

image

On the plus side, the site looks good, provided you can run Silverlight; and given the target readership that’s not too much of a stretch in this instance. Playing the embedded screencasts is very smooth, and they feel seamlessly integrated with the site, more so than with HTML plus a video plug-in.

That said, I found the site infuriating. Without thinking, I tried to scroll a document using the mouse wheel; nothing happened. The page up and down keys do not work either. Copying text works with Ctrl-C, but if you select and right-click, you just get the Silverlight “about” menu. I also found that the graphic effects – screens typically fade in as they change – made the site seem slow. Some things, like hyperlinks in full-screen mode, did not work as expected.

An interesting experiment; but for a site like this which is mainly about finding and reading documents, its hard to see a good reason not to use HTML.