Category Archives: silverlight

New York Times switches from WPF/Silverlight to Flash and AIR for Reader 2

The New York Times has released Version 2 of its Times Reader, for seamless online/offline viewing of its content. It’s interesting from a media perspective, but hardly a breakthrough, since it is not new. What’s more interesting to me is that the Times switched from a hybrid approach using WPF (Windows Presentation Framework) on Windows and Silverlight on the Mac, to Adobe AIR. Switches like this are bad PR for Microsoft, since it gives the impression that the developers were sufficiently unhappy with WPF/Silverlight, or so strongly attracted to AIR, that they were willing to throw away much of their previous development effort.

I’ve been tracking Times Reader for some years. It was presented at Microsoft Mix07 and I wrote up a panel discussion on the subject:

I asked about the cross-platform issue. According to Bodkin a Silverlight implementation is on the way, which includes most of the features in the full version, in “a matter of months.”

That was optimistic; but a Silverlight version was delivered and I used it successfully on the Mac; though it lacked some features of the WPF edition. It also attracted hostility from Mac users who are Microsoft-averse, as I reported here, and apparently ran into further problems because of incompatibility with Safari 4.

I tried the new AIR edition and it seems pretty good, though my impression is that it is not quite as smooth as the old WPF version. I might be wrong, since I could not install both on the same machine. The new version does add video support. Here’s the old one:

and this is the new effort:

I think this is a fascinating case study which demonstrates a number of things.

First, that cross-platform support is not an optional feature any more (if it ever was) for this kind of public application. Let’s assume here that the WPF version was just fine for Windows users, but was not viable long-term for lack of cross-platform support. It was inevitable that the Times would eventually either use Silverlight on both Windows and Mac, or abandon both WPF and Silverlight for a cross-platform alternative.

Second, that Silverlight is not yet mature enough for this kind of application. Although the Times developers were able to deliver a Silverlight version, it required a bit of hackery for offline support (embedded Safari on the Mac) and apparently ran into version problems when Apple upgraded Safari. Silverlight is also known to be poor for text rendering – a Google search for “blurry text Silverlight” brings back plenty of hits. Adobe also made a big improvement to text handling in Flash player 10, with the new flash.text.engine.

Third, that offline support really is a big deal. Would Silverlight 3.0 have been good enough? Possibly, though I haven’t seen any suggestion that Silverlight 3.0 offline apps will be able to run in the background while showing just an icon in the notification area, to support continuous synchronization.

It is possibel that these problems may be fixed in Silverlight 4.0. That’s a long time to wait though, when you need your application out now (and your industry is in crisis).

It would be silly to extrapolate this case study into a broader statement about the superiority of Flash over Silverlight. For the specific needs of the New York Times though, it is easy to see why Adobe AIR appeals.

First baby steps for Moonlight 2.0: Silverlight for Linux

Miguel de Icaza has announced the first preview release of Moonlight 2.0. This is the one that counts, in that it brings the .NET runtime to Silverlight applets running on Linux:

This is the ECMA VM running inside the browser and powering C# and any other CIL-compatible languages like Ruby, Python, Boo and others. You can use Moonlight/Silverlight as a GUI (this is what most folks do) or you can use it as the engine to power your Python/Ruby scripting in the browser.

The download page has plenty of health warnings:

Keep in mind this preview release is not feature complete. Most importantly not all security features are present or fully enabled in this release. Even existing security features have, at this stage, received only minimal testing and no security audit of the source code (mono or moonlight) has yet been done.

Undeterred, I installed it into FireFox 3.0, running on Ubuntu Linux. The download is under 9 MB. My first effort was unsuccessful; the plug-in appeared to load OK, but no Silverlight apps displayed. My second attempt in a VM worked. Naturally I went along to my Silverlight database example which as it happens runs on Mono. Here it is:

This is what it should look like (Silverlight on Windows):

Well, it is only an alpha preview, and it shows. On the plus side, the data is displayed, the search works, and the buttons operate. It is a considerable achievement. But don’t plan to move your users onto Moonlight applications just yet.

Flex Builder for Linux on hold: another sign of financial stress at Adobe?

On 21st April Adobe’s Ben Forta told a user group that Flex Builder 3 for Linux is on hold, citing lack of requisition, which is corp-speak for lack of demand.

Note that the Flex SDK does run on Linux. It is just the official IDE that is in question.

Linux is a free operating system, and this could be evidence that users of a free OS are less likely to purchase software than users of a paid-for OS. Or it could simply reflect poor market share for Linux outside servers. Even if it has just hit 1%, as hitslink reports, it is still barely more than 10% of the Mac share and a little over 1% of the Windows share. Some of those Linux machines will also be netbooks – secondary systems for users with a Windows or Mac for serious work such as design and development.

Nevertheless, I suspect there is more to it than that. I suspect Adobe would like to support Linux, because it wants to portray Flex as an open platform – the SDK is open source, though managed by Adobe, but the runtime engine is closed-source and proprietary. This may be another sign of Adobe’s financial stress. The company reported reduced quarter-on-quarter revenue for the the 3 months ending February 2009, and has been cutting staff numbers.

The backdrop to this, in contrast, is that Adobe is having great success with its Flash platform. There is no sign of Microsoft’s Silverlight denting the popularity of Flash on web sites, either for applets or media streaming.

The recession then? Partly; but this is also about Adobe’s business model. Adobe does not break out its figures in detail as far as I know: the last financial statement merely shows that its revenue is nearly 95% from product sales, the rest being services and support. Still, I’d guess that the largest component of its product sales must be Creative Suite. In other words, its business model is based on selling tools and giving away runtimes. When 47 million people watch Susan Boyle on YouTube, Adobe doesn’t make a penny, even though they are almost all using Flash to do so.

The tools market is a difficult one for various reasons, including competition from free products and the fact that the number of people needing development or design tools is always much smaller than the number needing runtimes. In a recession, deferring a tools upgrade is a obvious way for businesses to save money. Remaining primarily a tools company is a limit to Adobe’s growth and ultimately its profitability.

This is of concern to all Flash platform users. Adobe has proved to date a good steward of the technology. Some of us would like the balance of proprietary vs open tilted further towards open, but I doubt many would welcome a takeover or merger such as we have seen with Sun and Oracle (and there are a few parallels there).

There would also be many cries of “foul” if Adobe sought to further monetize Flash by starting to sell, say, a premium version of the Flash runtime.

Adobe is still a profitable company, and maybe when the economy recovers all this stress will be forgotten. Still, I’d guess that long-term Adobe will want to shift away from its dependency on sales of tools; and how and what it does to achieve that will have a big influence on the future of its RIA (Rich Internet Application) platform.

Faking synchronous web service calls in Silverlight

I ran into a small but thought-provoking problem in my sample Silverlight database application. I wanted to call a web service, and only call a second web service if the first was successful. The problem is that all web service calls are asynchronous, so you cannot do this with a simple if statement. The quick fix I used was to store my intended operation in a PendingOperation variable. When the first web service completes, it checks for a pending operation. If the first call succeeds and finds a pending operation, it calls the second web service to complete it.

My workaround is OK, but it got me thinking about the best way of doing this. What if you had a sequence of web services to call, and wanted to check for the success of each one before proceeding to the next? I discussed this on the Silverlight forums and was directed to this article by Daniel Vaughan which describes how to do this in a background thread. I haven’t tried his code yet; but it strikes me that this could be useful; I’d like to see Microsoft build something like it into the core framework. Since all the calls take place on a background thread, there is no danger of locking up the user interface.

If RIA programming is as important as some suggest we will have to get used to this kind of problem.

A Silverlight database application with image upload

I’ve been amusing myself creating a simple online database application using Silverlight. I had this mostly working a while back, but needed to finish off some pieces in order to get it fully functional.

This is created using Silverlight 2.0 and demonstrates the following:

  • A bound DataGrid (as you can see, work is still needed to get the dates formatted sensibly).
  • Integration with ASP.NET authentication. You have to log in to see the data, and you have to log in with admin rights to be able to update it.
  • Create,Retrieve,Update,Delete using ASP.NET web services.
  • Image upload using Silverlight and an ASP.NET handler.
  • Filter a DataGrid (idea taken from here).
  • Written in Visual Studio 2008, and hosted on this site, which runs Debian Linux, hence Mono and MySQL. Would you have known if I had not told you?

You can try it here. I’ll post the code eventually, but it will be a couple of months as it links in with another article.

MVP Ken Cox notes in a comment to Jesse Liberty’s blog:

Hundreds of us are scouring the Internet for a realistic (but manageable and not over-engineered) sample of manipulating data (CRUD operations) in a Silverlight 2 application. There are promising pieces of the puzzle scattered all over the place. Unfortunately, after investing time in a sample, we discover it lacks a key element – like actually saving changed data back to the database.

I can safely say that mine is not over-engineered, and that yes, it does write data.

Is Silverlight the problem with ITV Player? Microsoft, you have a problem.

I sat down last night to watch a programme on ITV’s catch-up service, using the Silverlight-based ITV Player. It was watchable, but not too good. Now and again the stream would pause for buffering, and I saw the Silverlight busy icon for a while. Quality is also an issue. Sometimes it is great; sometimes it is horribly pixelated.

I took a look at the ITV forums. It seems to be a common problem. The Best of ITV section is dominated by complaints. Some are from an aggrieved minority running Linux or PowerPC Macs; but there are plenty of others. My experience is relatively good; other issues include broadcasts that only play the ads; or codec issues; or streams failing completely half way through a programme. Here’s a sample:

Believe me guys even if you had Windows OS the player still wouldn’t work its completely rubbish; 6 times i’ve tried to watch Britains Got Talent and it either vanishes, or skips etc.
Rubbish, rubbish, rubbish! BBC iPlayer is excellent compared to this, i’m quite disappointed!

Readers of this blog will know that I have nothing against Silverlight, though my interest is more in the application development side than video streaming. Still, the impact of one on the other should not be discounted. You can guess what the pundits in the ITV forum are calling for. It’s Adobe Flash, because they have seen it working well for the BBC and elsewhere.

Now transition to the development team as they put forward the question of whether to use Flash or Silverlight for their upcoming RIA (Rich Internet Application) project. If the exec responsible struggled to watch ITV player the night before, thanks as far as she can tell to the Silverlight plug-in, that becomes a factor in the outcome.

I understand why people blame Silverlight for these problems; but I realise that this may be wrong, cross-platform issues aside. Maybe ITV has inadequate servers; or there is some other technical issue, and Silverlight is innocent.

If you know the answer to this, please let me know or comment below.

Microsoft must realise, though, that this is the most visible use of Silverlight for many UK folk. Some may also remember how BBC iPlayer transformed its reputation when it moved from using primarily Microsoft technology – though not Silverlight, and made worse by poor peer-to-peer client software – to Adobe’s Flash platform. I suggest that Redmond’s finest give it some attention; though who knows, it may be too late.

RIA (Rich Internet Applications): one day, all applications will be like this

I loved this piece by Robin Bloor on The PC, The Cloud, RIA and the future. My favourite line:

Nowadays very few Mac/PC users have any idea where any program is executing.

And why should they? Users want stuff to just work, after all. Bloor says more clearly than I have managed why RIA is the future of client computing. He emphasises the cost savings of multi-tenancy, and the importance of offline capability; he says the PC will become a caching device. He thinks Google Chrome is significant. So do I. He makes an interesting point about piracy:

All apps will gradually move to RIA as a matter of vendor self interest. (They’d be mad not to, it prevents theft entirely.)

Bloor has said some of this before, of course, and been only half-right. In 1997 he made his remark that

Java is the epicenter of a software earthquake, and the shockwaves are already shaking the foundations of the software industry.

predicting that Java browser-hosted or thin clients would dominate computing; he was wrong about Java’s impact, though perhaps he could have been right if Sun had evolved the Java client runtime to be more like Adobe Flash or Microsoft Silverlight, prior to its recent hurried efforts with JavaFX. I also suspect that Microsoft and Windows have prospered more than Bloor expected in the intervening 12 years. These two things may be connected.

I think Bloor is more than half-right this time round, and that the RIA model with offline capability will grow in importance, making Flash vs Silverlight vs AJAX a key battleground.

Tim Bray’s contrarian views on Rich Internet Applications

There’s a though-provoking interview with Sun’s Tim Bray over on the InfoQ site. One of his points is that Rich Internet Applications aren’t worth the hype. He says that web applications are generally better than desktop applications, because they enforce simplicity and support a back button, and that users prefer them. He adds:

Over the years since then I have regularly and steadily heard them saying: "We need something that is more immersive, more responsive, more interactive". Every time without exception that somebody said that to me, they have either been a developer or a vendor who wants to sell the technology that is immersive or responsive, or something like that. I have not once in all those years heard an ordinary user say "Oh I wish we go back to before the days of the web when every application was different and idiosyncratic … ".

In further gloomy news for advocates of Adobe Flash, Microsoft Silverlight or Sun’s own JavaFX he adds:

I suspect that the gap in the ecosystem that lies between what you could achieve with Ajax and what you need something like Flash or JavaFX or Silverlight to achieve is not that big enough to be terribly interesting.

I think there is a lot of truth in what he says, and I still regularly see Flash applications or Flash-enabled sites where I wish the developers or designers had not bothered. Nevertheless, I don’t go along with it completely. I’m typing this post in Live Writer, a desktop application, when I could be using the WordPress online editor. The reason is that I much prefer it. It is faster, smoother, and easier to use.

Another example is Twitter clients. I use Twhirl though I may switch to Tweetdeck; both are Flash (AIR) applications running as it happens outside the browser. I’d hate to go back to interacting with Twitter only through web pages.

I agree there there is some convergence going on between what we loosely call Ajax, and the RIA plug-ins; Yahoo Pipes apparently uses the HTML 5 Canvas element, for example, using this Google Code script for IE support. I’m glad there is a choice of RIA platforms, but I don’t see either Flash or Silverlight going away in the forseeable future.

It’s worth recalling that the RIA concept began with the notion that a rich user interface can be more productive and user-friendly than an HTML equivalent. I’ve written a fair amount about the legendary iHotelier Broadmoor Hotel booking application which kind-of kicked it off – and I’ve interviewed the guy who developed it – and it was undoubtedly motivated by the desire to improve usability. As far as I can tell it achieved its goals, which were easy to measure in that online bookings increased.

Multimedia, rich visual controls, Deep Zoom, offline support, pixel-level control of the UI; there’s a lot of stuff in what we currently call RIA that is worthwhile when used appropriately.

Another twist on this is that RIA is enabling a more complete move to web applications, by reducing the number of applications that do not work either in the browser, or as offline-enabled Flash or Silverlight.

Still, Bray is right to imply that RIAs also increase the number of ways developers can get the UI wrong; and that in many cases HTML with a dash of Ajax is a better choice.

I think the RIA space is more significant than Bray suggests; but his comments are nonetheless a useful corrective.

Leaving Las Vegas: Mix09 wrap-up

I’m heading back to London after 3 days at Microsoft’s Mix09 conference in Las Vegas. I took the opportunity to ask a few delegates what they thought. One thing that everyone seemed to love was SketchFlow, a new feature of Expression Blend which enables designers to sketch out design ideas, distribute them for discussion and annotation, collect responses, and export the results to Word to create a report or proposal. It looks like SketchFlow has been influenced by Bill Buxton, who gave a keynote at Mix, since it embodies one of his key ideas, that design ideas should not look too finished as that inhibits the response.

There was also enthusiasm for Silverlight 3.0, with its numerous new features including out-of-browser support. Several Adobe folk were at Mix sizing up the competition; one was Mike Downey who commented:

I’m really impressed by how much Microsoft has gotten done with this whole platform so quickly. They’re catching up really fast. #mix09

It’s true that Silverlight is maturing with remarkable speed, and many of the developers I spoke to were using it or planning to use it.

That said, we are really talking about Microsoft platform people, most from a developer background. I got some insight into what Microsoft is up against chatting to some design students and a lecturer on the bus to the airport. Microsoft sponsored their visit to Mix in an attempt to get them interested. They all use both Macs and Adobe tools; and the lecturer said to me, “we already get the students to install 7 different pieces of software for the courses we run; why should I add two more (meaning, I think, Expression Blend and Visual Studio)? The Mac issue is huge; there is some work being done to support Silverlight design on the Mac, but it is rudimentary in comparison to Blend.

The sessions on ASP.NET MVC were well attended and of the developers I spoke to, those who grasp what it does are delighted with it and intend to use it – several had evolved their own ASP.NET frameworks out of frustration with Web Forms. It appears though that Microsoft didn’t pitch ASP.NET MVC in a way that communicated well with developers not already familiar with it. Some had attended sessions but still didn’t really grok what it does.

Mix day one, with the Buxton/Guthrie keynote, went down better than day two, which had the IE8 launch and Deborah Adler presenting her research and commercial success designing medicine bottles – interesting but over-long in a web conference. IE8, which was a highlight of Mix08, didn’t make much impact here as everyone already knew all about it, and it no longer looks so impressive one year on, even though it is a big advance on IE7.

Windows Azure didn’t appear to make much impression here, though there is relief that SQL Data Services is getting full relational features. I attended a UK round table on Azure with the other UK journalists who made it out here, Jon Honeyball, Simon Bisson and Mary Branscombe. I observed that Azure is widely misunderstood or not understood, that the follow-up since PDC has been poor, and that the web site relies too much on videos and is confusing to navigate; the early access system based on developer tokens is also problematic. I reckon Microsoft needs to do more work on communicating what Azure is about, if it is to win any mindshare from other cloud contenders.

Still, overall this was a good Mix; one delegate said it was the best Microsoft conference he’d ever attended. The wi-fi worked. The conference layout is good for networking and the warm atmosphere was not just a consequence of the desert air.

By the way – Mix10 has been announced, same place, March 15 – 17, 2010.

How to print in Silverlight out of the browser

Trick question, you can’t, or not in any sane way that I’ve discovered. When an app using Microsoft Silverlight is running in the browser you at least have the browser’s print features, but a SLOOB (Silverlight Out of Browser, a new feature in Silverlight 3) does not even have that to fall back on.

This is unfortunate for business applications, though of course many applications are fine without print features.

Workarounds: well, you can press Alt+PrintScreen and paste into Paint…

Another idea is to generate a document in code, then let the user “download” it from your SLOOB to somewhere on the desktop, since finding a document in the app’s isolated storage would be a challenge. The user can then print the document at his or her leisure.

What this illustrates is that even in version 3.0, Silverlight is not altogether mature, especially for this new out-of-browser feature. I’m told that print support is planned in some future version – Silverlight 4.0 I guess. Software is always a waiting game.

Note this post is based on the Silverlight 3.0 beta; it’s just possible something could be added in the final version.

Technorati Tags: ,,