Category Archives: web authoring

My first Google Chrome Web Application

Update: this post is based on obsolete beta code. Please go to the updated version here.

When I read Patrick Aljord’s blog on how to create Chrome Apps I thought, “that looks easy”. So I installed the dev channel version of Chrome as advised here, though on a VM just to be safe, and set about creating my own.

Well, WordPress is a web application; so my example is this blog. I created a manifest in Notepad.

image

Next, using my artistic skills, I made two icons of the required size: 24×24 and 128×128.

I ran the dev. build of Chrome using the –enable-apps switch. On the Extensions tab there are tools for building a .crx, which is the container for a Chrome Web App. I built the app, then installed it.

image

You get a generic warning about the extension. I was surprised not to see a stronger complaint about my app having no authenticated signature – it could be from anywhere. I guess this may be changed for the final release.

After installing, the app appears in the Chrome New Tab page.

image

You can try my web app here.

The whole process is very simple, which I like. It is also almost the same thing as a bookmark or favourite link. The main differences that I can see:

  • Apps get pride of place on the default Chrome Home page.
  • Apps can be installed from the forthcoming Chrome Web Store, with user reviews, a payment model, and so on.
  • Apps can have extra permissions.
  • Apps can be locally installed as “serverless” apps – this is huge, especially for the forthcoming Chrome OS which has no other provision for local applications.

Incidentally, if you try installing an app into the current standard build of Chrome, it installs as an extension but does not do anything. I also had to omit the “permissions” section of the manifest, otherwise I got an invalid permissions error when installing. In the developer build all was fine.

I tried dragging my app from Chrome to the desktop to make a shortcut. It worked, but simply created a standard web shortcut, which opens in your default browser, not necessarily in Chrome.

It is all so easy that it will make sense for almost anyone to create a Chrome Web App from their web property. Which also means there will be plenty of junk web apps around.

I’m not clear exactly how the Web Store will work. While I would love to sell URLs for money, they are not inherently of any value, though a serverless app is different. Presumably the normal thing would be to sell some sort of subscription, which implies registration and user authentication. No doubt everything will work smoothly if you use a Google ID as your authentication provider, though I hope Google will also provide for alternative systems.

Adobe’s campaign against Apple misses the target

Nothing better demonstrates Adobe’s concern about being locked out of Apple’s mobile platform than a huge advertising campaign attempting, one assumes, to win public support and pressure Apple into yielding ground.

Still, if you are going to run a big PR campaign it helps to be right. But Adobe seems to be arguing that Flash support is essential to an open web, which is incorrect.

We believe that consumers should be able to freely access their favorite content and applications, regardless of what computer they have, what browser they like, or what device suits their needs. No company — no matter how big or how creative — should dictate what you can create, how you create it, or what you can experience on the web. … In the end, we believe the question is really this: Who controls the World Wide Web? And we believe the answer is: nobody — and everybody, but certainly not a single company.

says the open letter from Adobe founders Churck Geschke and John Warnock.

Very good, but this is not an argument in favour of Flash. Flash is not part of HTML, Flash is not a standard, and Flash is not open – the specification for the player is published, but what goes into that specification is controlled solely by Adobe, and its player implementation is not open source. Flash is a proprietary plug-in. Are Geschke and Warnock arguing that all browsers on all devices should allow all plug-ins to be installed – including Silverlight, Java, ActiveX, and anything else you can think of? Or are they arguing that Adobe Flash is a special case? It is certainly a special case for Adobe, but any company will argue in favour of its own stuff.

The full-page advertisement that I’ve seen in various newspapers is not much better. Adobe’s pitch is that Apple is:

taking away your freedom to choose what you create, how you create it, and what you experience on the web

This again is incorrect. Apple has an excellent mobile browser based on WebKit, as also used by Google, Adobe and others. You can do what you want on the Web, but if you use Flash it won’t render on Apple’s mobile devices. All that means is that Apple has chosen not to support Adobe’s plug-in. It is not an issue of freedom.

Personally I don’t like Apple’s approach. I’d prefer it to support the leading plug-ins (not only Flash); I don’t like the appification of the web -  dubbed the splinternet, or splintered web, by some. And I particularly object to Apple’s clause 3.3.1 in its new developer agreement, which blocks apps that are created with cross-platform tools, no matter how well they perform or how good they look. That, it seems to me, is anti-competitive in spirit.

I think Adobe should make more of clause 3.3.1, rather than indulging in special pleading for its plug-in. And if I were Adobe, I wouldn’t be whinging about Flash being blocked. Rather, I’d be highlighting all the great things Flash can do, and all the content you will miss without it. My full-page ad would say, “Mr Jobs, your iPhone is broken”, and extol the merits of Android and other devices that will run Flash.

I’d also be working on the technical arguments, that Flash is unstable, insecure and resource-hungry. Is it Apple’s fault? Is it because of poorly coded SWFs, and if so what is Adobe doing about that? And how will Adobe improve Flash so that it behaves better in future, and not be perceived as the new Vista?

Maybe next time round?image

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.

After Apple’s Flash ban, what next for Adobe?

I imagine there must be urgent meetings taking place at Adobe following Apple’s prohibition of Flash content or applications on its iPhone and iPad devices, and last week’s open letter from Apple CEO Steve Jobs which leaves little hope of a change in policy.

The problem is that until now Adobe has put the Flash runtime at the heart of its strategy. The Flash Platform is a suite of tools and technologies including middleware (LiveCycle Data Services), web and desktop runtimes (Flash and AIR), design and developer tools (Creative Suite and Flash Builder). The company has worked to integrate Flash and PDF, using embedded Flash content for multimedia and to blur the boundaries between documents and applications.

If you look at Creative Suite 5, the latest release of Adobe’s flagship tools and from which it derives most of its revenue, there is scarcely a product within it which Flash does not touch.

Adobe’s hosted document and collaboration platform, Acrobat.com, uses Flash for online document viewing and editing, for web conferencing, for online presentations.

Adobe’s abandoned Flash to iPhone compiler was not only something for third-party developers, but also for Adobe itself, and the company has already been using it to enable access from iPhone to some of its Flash-based online services. For example, Adobe Acrobat Connect Pro Mobile for iPhone, which lets you attend Acrobat Connect Pro meetings:

This application was developed using the Flash platform and the Packager for iPhone to publish it as a native iPhone application. We will also be able to use the same code to deliver this application on other mobile devices when AIR for mobile devices becomes available later this year.

Of course Adobe is not solely a Flash company. It’s also a PDF company, and while there is no Adobe Reader for iPhone, it is at least possible to view PDFs on Apple’s devices. Adobe is an HTML company too, and products like Dreamweaver and Fireworks are geared towards HTML content.

Still, Apple has created a big problem for Adobe. The appeal of the Flash Platform starts with the ubiquity of the runtime.

Let’s assume that Apple trundles on, grabbing an increasing share of the Smartphone market and encroaching into what we now think of as the laptop/netbook market with iPad and possibly other appliance-type computing devices. What can Adobe do? Here are a couple of top-level choices that occur to me:

1. Resign itself to being an anything-but-Apple company. There is life beyond iPhone and iPad; and Adobe is making good progress towards establishing Flash elsewhere, from Android mobiles to set-top boxes to games consoles. Unfortunately the Apple-owning community is a wealthy and influential one; the impact of losing that part of the market is greater than its market share implies. Nevertheless, this seems to be Adobe’s immediate reaction to the Jobs bombshell. It is rumoured to be giving Android phones to its employees, for example, and there are signs of an Adobe-Google alliance forming against Apple – note that Google is building Flash by default into its Chrome browser.

2. Pull back on Flash. For example, redesign Buzzword, its Flash-based online document editor, in HTML and JavaScript. Tune its PR message to emphasise how useful its tools are in an non-Flash context, rather than presuming its runtime will be everywhere. I think Adobe will have to do this to some extent.

A mitigating factor is that while Adobe has (until now) done a great job of deploying the Flash runtime, it has done less well at monetising it. If you look at its latest financials, you’ll see that Flash Platform (including AIR) accounted for only 6% of its revenue, compared to 50% for design tools including Creative Suite and Photoshop, 28% for business use of Acrobat, and 10% for the recently acquired Omniture web analytics. Although some of its design market is Flash-dependent, there is plenty more that is not.

Steve Jobs saying Flash is bad does not make it so

I’ve mulled over the statement by Apple CEO Steve Jobs on why he hates Flash. It’s been picked over by many, so there’s little point in analysing it line by line, spotting what’s true, what’s false, what’s twisted. It doesn’t matter. What counts is that Jobs is disallowing Flash and attacking Adobe – he’s decided it should get out of the runtime business and just do tools for HTML5:

Perhaps Adobe should focus more on creating great HTML5 tools for the future

Apple is a powerful enemy; and what I’ve found alarming watching the reaction is the extent to which Jobs saying “Flash is bad” has lowered the reputation of Flash; it’s as if all the great things which it has enabled – web video that works, pushing the boundaries of what is possible in a web browser, an entire industry of casual gaming – has been forgotten because one charismatic and influential individual has called it old stuff that crashes Macs.

The army of enthusiasts which leaps to the defence of all things Apple both amuses and disturbs me. I understand some of the reasons. People warm to Apple because the company has improved their lives, in computing, in music, in mobile phones – especially in contrast to the efforts of Microsoft and its partners who have all too often made computers and mobile devices that are hostile and unpleasant to use. This last factor is not Apple’s fault; and without Apple it might not now be changing. Apple deserves our thanks for that.

That doesn’t make Jobs or his followers right about Flash, which is a magical piece of technology. Yes, it’s been widely abused to make annoying ads and animations; yes, it crashes the browser sometimes; yes, both HTML5 and Microsoft Silverlight are encroaching on Flash territory.

Still, Flash is never going to be allowed on Apple’s new wave of personal computing devices, which by the looks of things it intends to form the core of its business. Nor can we write for Flash and compile for Apple; it’s not allowed.

This is the new model of computing: the web if you want open, or humbly seek permission from the device overlords if you want a local application install, at least on Apple’s platform; and Microsoft is headed in the same direction with Windows Mobile 7. It’s not a model I like; but the trend is unmistakeable.

Microsoft Expression Blend is too hard to learn

Expression Blend is the design tool for Windows Presentation Foundation (WPF) and Silverlight, and thus a key tool for building applications for the current generation of Microsoft’s platform. How good is it? There is a shortage of in-depth reviews, if my quick Google search is anything to go by, though there are plenty of quick write-ups saying that it is not as good as Adobe Flash. Blend got a bit of attention following the 2009 Mix conference thanks to SketchFlow, the prototyping feature built into Blend 3, and which has been well received.

One reason for Blend’s relatively low profile is that it is aimed at designers, whereas Microsoft’s community is more developer-focused. WPF developers can avoid Blend to a large extent, by using the designer built into Visual Studio, which is fine for laying out typical business applications. Now with Visual Studio 2010 the same is true for Silverlight. Another option is to write your own XAML code, which works for laying out controls though it is inconceivable for drawings. XAML is verbose

It is just as well you can avoid it, because although Blend is very capable, it is not easy to learn. I’m guessing there are quite a few developers who have opened it up, clicked around a bit, and retreated gratefully back to Visual Studio. This was a problem for Adobe Flash Professional as well, and one of the reasons for the creation of Flex and Flex Builder, a code-centric IDE for the Flash runtime.

You can argue that a design tool does not need to be easy for developers to use; it needs to be good enough for designers to create great designs. That’s true; but the developer/design divide is not a absolute one, and ideally Blend should be something a developer can dip into easily, to create or enhance a simple layout, without too much stress.

Maybe some developers can; but I have not found Blend particularly intuitive. The user interface is busy, and finding what you want or getting focus on the right object can be a challenge.

As evidence of this, take a look at Adam Kinney’s Through the Eyes of Expression Blend tutorial, which is among the best I have found. Try lesson 9, Styling and working with design-time data. Then ask yourself how easy it would be to discover the way to do this without the step-by-step instructions. Would you have known to right-click the StackPanel and choose Change Layout Type > Grid? What about step 8, right-clicking the ListBox, and selecting Edit Additional Templates > Edit Layout of Items (Items Panel) > Create Empty?

image  

And notice how in step 9 you have to click the “small grey square next to the Source property”, that’s the one called Advanced Options:

image

Overall it is a nice tutorial, but you might need an evening or two with a couple of fat books, one on XAML and one on Blend itself (if you can find a good one), in order to understand the features you have have been using.

It is probably worth it, if you intend to work with Silverlight or WPF. Blend has one great advantage over Flash Professional: it authors XAML, and you can open it up in Visual Studio and continue working on it there. Microsoft has no need for something like Adobe Catalyst to bridge the XML/Designer divide.

Still, Microsoft had a clean slate with Blend, which is only a few years old, and it is a shame it could not come up with something a bit more user-friendly.

The other implication is that the new visual designer in Visual Studio 2010 makes Silverlight applications a great deal easier to create. You can Blend if you want to; but the Visual Studio effort is far more approachable.

How do you find Blend? I’d be interested in other perspectives.

Silverlight 4 vs Silverlight 3: a little bit faster?

Microsoft’s Scott Guthrie spoke of “twice as fast performance” in the newly-released Silverlight 4, thanks to a new just-in-time compiler.

Performance is a hard thing to nail down. Maybe he meant that compilation is twice as fast? I’m not sure; but I tried a couple of quick tests.

First, I looked at my Primes test. Version 3 running in Windows Vista took around 0.40 seconds (the exact figure varies on each run, thanks to background processes or other factors). I then upgraded to version 4.0. No significant difference, on average over several runs. I used Vista because I’d already upgraded my Windows 7 install.

Next I tried Bubblemark. I maxed it out at 128 bubbles. On Vista with Silverlight 3 I got about 240 fps; on the same machine with Silverlight 4 about 260fps; about 8%.

image

Next I tried on an Apple Mac. My Mac Mini is less powerful, though not that bad, an Intel 1.83 Ghz Core Duo. On the Prime test I got 0.54 secs before, and 0.50 secs after the upgrade to 4.0, about 7.5% improvement. On Bubblemark, it was only 24 fps before and after.

I guess the vast difference in graphics performance is also interesting. It is not just Mac vs Windows; the Nvidia GeForce 6800 on the PC is more powerful than whatever is in the Mac Mini.

If anyone can tell me in what respect version 4.0 is twice as fast, I’d be grateful.

Update: prompted by the comment from David Heffernan below, I also tried the Encog Silverlight Benchmark. I used an older core duo laptop, since I am running out of machines to upgrade. I ran the test twice before upgrading, and twice after. Lower is better:

Silverlight 3.0: 22.0

Silverlight 4.0: 12.7

That’s about 42% better, where “twice as fast” would be 50% better, much closer to Guthrie’s claim. I guess it depends what you measure.

Silverlight 4.0 released to the web; tools still not final

Microsoft released the Silverlight 4.0 runtime yesterday. Developers can also download the Silverlight 4 Tools; but they are not yet done:

Note that this is a second Release Candidate (RC2) for the tools; the final release will be announced in the coming weeks.

Although it is not stated explicitly, I assume it is fine to use these tools for production work.

Another product needed for Silverlight development but still not final is Expression Blend 4.0. This is the designer-focused IDE for Silverlight and Windows Presentation Foundation. Microsoft has made the release candidate available, but it looks as if the final version will be even later than that for Silverlight 4 Tools.

Disappointing in the context of the launch of Visual Studio 2010; but bear in mind that Silverlight has been developed remarkably fast overall. There are huge new features in version 4, which was first announced at the PDC last November; and that followed only a few months after the release of version 3 last summer.

Why all this energy behind Silverlight? It’s partly Adobe Flash catch-up, I guess, with Silverlight 4 competing more closely with Adobe AIR; and partly a realisation that Silverlight can be the unifying technology that brings together web and client, mobile and desktop for Microsoft. It’s a patchy story of course – not only is the appearance of Silverlight on Apple iPhone or iPad vanishingly unlikely, but more worrying for Microsoft, I hear few people even asking for it.

Even so, Silverlight 4.0 plus Visual Studio 2010 is a capable platform; it will be interesting to see how well it is taken up by developers. If version 4.0 is still not enough to drive mainstream adoption, then I doubt whether any version will do it.

That also raises the question: how can we measure Silverlight take-up? The riastats charts tell us about browser deployment, but while that is important, it only tells us how many have hit some Silverlight content and allowed the plug-in to install. I look at things like activity in the Silverlight forums:

Our forums have 217,426 threads and 247,562 posts, contributed by 77,034 members from around the world. In the past day, we had 108 new threads, 529 new posts, and 70 new users.

it says currently – substantial, but not yet indicative of a major platform shift. Or job stats – 309 UK vacancies right now, according to itjobswatch, putting it behind WPF at 662 vacancies and Adobe Flash at 740. C# on the other hand has 5349; Java 6023.

Book Reviews: Programming F# and Beginning F#

I’ve been working with Microsoft’s new language F# recently and enjoying it. If it catches your interest, you might turn to a book in order to familiarise yourself with the basics. Here are two which I’ve looked at. They are both aimed at experienced developers who are new to F#.

Programming F# by Chris Smith

Programming F# comes from O’Reilly. It kicks off with Hello World and an introduction to the interactive console in Visual Studio 2010 – a great way to try out F#. Next we get a summary of types, and a brief explanation of how to write an F# program – stuff you have to know.

Chapter 3 is an introduction to functional programming, and also mentions type inference, an important F# feature. The following chapter explains mutable programming in F# – yes, you can do it; it is just not the default behaviour – and also covers exceptions. Chapter 5 turns to object-oriented programming in F#, another distinctive feature, while chapter 6 covers aspects specific to .NET such as garbage collection. That’s about half the book, and gets you up and running with the language.

The second half of the book is more interesting, looking at ways of using F#. Smith looks at applied functional programming, including pattern matching, recursion, continuations and closures. Next, there’s a look at applied object orientation. Chapter 9 covers scripting with F# – an interesting use case – and includes welcome examples for things like copying files and automating Microsoft Office. Chapter 10 is a key one, explaining computation expressions that let you create workflows and all-but extend the language. It’s “a very advanced concept that even expert developers can have a hard time grasping,” admits the author, though he presents it clearly.

Next we get a section on a likely reason for picking up F#: asynchronous and parallel programming. There’s a wide-ranging chapter explaining both .NET and F# asynchronous techniques, including the .NET Parallel Extensions. It’s a little confusing, especially since Smith observes that F# asynchronous workflows are sub-optimal for CPU parallelism; he recommends the .NET Parallel Extensions because of the better thread management it offers.

The last chapters cover .NET Reflection, code analysis and generation with Quotations – “deep wizardry”, says the author. An appendix summarises .NET Libraries and F# interop with COM and native code.

While this is an excellent language introduction, and thorough within the topics it covers, some aspects disappointed me. I cannot find any mention of F# agents, based on the MailboxProcessor class (nothing to do with email), which is a surprising omission; F# designer Don Syme sees it as a critical feature for scalable web development. Nor is there anything on graphics processing, another common usage, or any hint about how you might use F# for financial analysis. I also found it rather dry overall – hard to avoid with so much plumbing to cover, but I feel the author could have conveyed a little more excitement about what F# enables. Don’t make this the only F# book you read.

Beginning F# by Robert Pickering

This Apress title covers similar ground as the O’Reilly book, but with a slightly more hands-on and informal style, which on the whole I enjoyed. It starts with an introduction including a quote from Ralf Herbrich at Microsoft Research describing how he converted 1000 lines of C# into 100 lines of F# which performed just as well – this is the kind of real-world touch that makes you want to read on. The second chapter explains how to install F#, including different versions of Visual Studio, the open source SharpDevelop, and Mono on Linux – excellent diversity. Chapter 3 introduces functional programming, in effect a brisk overview of the core of F#. Read it slowly!

The author goes on to look at imperative programming and mutability in F#, and then object orientation, just as Smith did in his book. Chapter 6 is useful overview of how code is organised into modules and namespaces, and also covers comment annotations. Next, Pickering looks at F# libraries, including a brief look at math programming. Chapter 8 covers user interface coding – completely lacking in Smith’s book – complete with a quick look at GTK#, which works on Linux. There’s also a quick look at ASP.NET, Microsoft’s web server platform. Although this little introductions are too brief to be really useful, they do spark ideas about how you might use F#.

Data Access is next, another important real-world topic, covering XML, LINQ (Language Integrated Query) and ADO.NET.

Chapter 10 is when we get to parallel programming and reactive programming – code that waits for an external event before running. Pickering introduces F# agents and the MailboxProcessor class. Next comes a look at distributed applications using sockets, HTTP requests, web services, and Windows Communication Foundation.

Chapter 12 has the intriguing title Language-Oriented Programming, and should be taken together with the next chapter on parsing text. This is where we look at using data structures as little languages, parsing and interpreting text, and extending F# syntax. Finally, chapter 14 is the interop chapter, covering interop with C# as well as platform invocation for COM and native code.

Of the two books, this is the more lively and wide-ranging read, and more likely to enthuse you about the possibilities F# offers, though it skims the surface in places; many topics receive only shallow coverage.

View on Amazon.com

 

View on Amazon.co.uk

 

No Flash on iPad? No problem – we’ll redesign the site says NPR and others

It is fascinating to see the impact of Apple’s hostility to Adobe Flash on iPhone and now iPad.

On the one hand, it’s a gift to rival vendors such as Google, which is bundling Flash into Chrome (a contentious decision judging by the comments), and Microsoft, which has promised Flash support in Windows Phone 7, though not in the first release. These vendors can claim better Internet support than Apple, thanks to the large amount of Flash content, games and applications on the Web.

On the other hand, I’ve not seen many web sites that encourage their users not to use iPhone or iPad. Rather, those with the resources to do so are simply making their content available in ways that are iPhone/iPad compatible. There are two obvious ways to do so: either create an App, or make a Flash-free web site.

One of my favourite music sites is NPR, which is a great source of concerts and exclusive sessions, and which uses Flash for streaming. NPR’s research told it that five percent of its 26 million weekly listeners were likely to purchase an iPad. I was also intrigued to note that these purchasers consider it more of a “living space” device than something they take everywhere. Either way, they wanted to continue consuming NPR’s content.

NPR responded by taking both of the options mentioned above: a redesigned web site, optimised for touch control as well as eliminating Flash, and an iPad app that builds on an existing iPhone app.

We’re excited about this latest innovation because we think it brings us closer to capturing NPR’s unique identity on a digital platform. The iPad’s casual touch-screen navigation seems more conducive to immersive reading than even the lightest laptops. And it opens up new opportunities for casual listening.

The worrying thought for Adobe is that sites such as NPR might decide to use the Flash-free site for all browsers, instead of just those on an iPad, to save on duplicate work.

Adobe’s decision to enable native compilation to iPhone and iPad in the forthcoming Creative Suite 5 is looking increasingly significant.

Update: James Governor on Twitter says awesome! the new IE6! Good point, though how you see this depends on what you think of Flash in the first place.

Stephan Richter observes that “Judging by the comments, not many NPR users are happy that effort is wasted on supporting 5% of potential users.” There’s certainly evidence of resentment at Apple users getting preferential resources, though the fact that Apple purchasers pretty much match the dream profile for many advertisers may be a factor.