First steps with offline Silverlight and Live Framework

Yesterday I wrote a simple test application for Silverlight running on Live Mesh. It is an interesting scenario, which enables Silverlight applications to run offline, in the style of Adobe AIR. I wrote a to-do list which stores its data in the cloud; I added some items online, and deleted and added some items offline on another machine, and when it reconnected all the edits synchronized. Cool.

Even so, I’m not finding this particularly easy. Note that this is a limited-access Community Tech Preview, so make big allowance for that. Here are some of the problems I’ve run into to:

Convoluted sign-up and web site navigation.

This is a preview controlled by developer tokens. It’s complicated by the fact that a variety of different types of token control access to different parts of Windows Azure. You get a token, think you are done, then discover you have the wrong kind of token and need to apply for another one.

Even when you have the token, navigation is tricky. I’ve wasted time clicking through from one overview page to another; there are even promising links that seem to go back to the page you are looking at. Tip: when you find a useful page like the Developer Portal, for provisioning Azure and Live Framework apps, bookmark it quick.

Inadequate documentation.

OK, I guess this is to be expected in a preview. But I’m finding an over-abundance of overviews and diagrams, too many videos, and a lack of plain-speaking developer-focused documentation that answers obvious questions. Most of the entries in the .NET reference for the Live Framework client look like this:

That’s right, auto-generated docs with no description of what the class member is for or how to use it. You can expand the plus symbols, but it is not rewarding.

Slow going

Microsoft’s online MSDN documentation and forums work, but I never look forward to visiting them because I know they will be slow to navigate and I’ll be sitting waiting for pages to refresh. I’m not sure that Microsoft understands the importance of this point. It works – so why complain? Well, because the cumulative effect over time is to make me want to go elsewhere. Google and Yahoo, by contrast, usually run much more responsive sites.

Microsoft could improve this quite easily. The key: fast is more important than pretty.

Bugs and outages

I certainly expect bugs and outages in a CTP. Still, they are frustrating. My very simple Mesh app did not work at all on a Mac, even running in the browser. In this scenario, you don’t need the Mesh client; it is just a Silverlight application running in a web page. I asked about this on the forum:

I confirm it from the core team. With quite aggressive timeline for PDC release with the current level of resources and CTP goals, we could only test XP SP3/Vista SP1 and IE7. We will eventually support Mac and Safari but this is not an immediate priority in the near future for CTP QFEs.

Fair enough, thought to me cross-platform is at the heart of why I might want to use this technology.

This morning my Silverlight Mesh application won’t run at all. I get a 404. I guess it’s the bleeding edge.

Online/Offline

I’ve also asked a couple of simple questions on the forum about the online/offline scenario. I’m finding that offline applications don’t run unless you are signed into Windows Live. That is, you can sign in and then go offline, and it works, but if you don’t sign in (for example, because you start up your laptop in an aeroplane), then the app does not start. There must be some way to use cached credentials?

My other question is about synchronization. How do you enforce constraints on a Mesh datafeed, given that it could be edited online and offline simultaneously, bypassing checks in your code? This is not quite the same as a conflict, where the same entry is edited by two different people. My example is how to make sure that duplicate items are not added to a list.

Early days

I expect that this Azure stuff will get much smoother in future updates; and bear in mind that what I’m working with here – Mesh, Silverlight, and the .NET Live Framework client library – is just one small corner of the whole.

I can’t help wondering though if Microsoft is being over-ambitious. Another technology I’ve been looking at recently is Adobe AIR. The scope of this is small relative to Live Mesh. You can describe it in a few words: run a Flash application on the desktop. It has limitations and frustrations, but at least it is easy to understand, and furthermore, it has pretty much worked as advertised from the earliest public previews.

By contrast, Mesh for developers feels like a huge thing that is part of an even huger thing (Azure); it has lots of promise, but it is harder to describe its essence in a few words (that are not marketing fluff).

That said, I like Silverlight itself. This piece at least is easy to grasp and works well, in my experience so far.

Working with Live Framework or Azure? I’d love to know how it is going for you.

JavaFX warns against itself on Macs

If you navigate to JavaFX.com on a Mac, you get this warning – at least, I do, and so does at least one other:

In case you can’t read it, it says:

This applet was signed by “JavaFX 1.0 Runtime,” but Java cannot verify the authenticity of the signature’s certificate. Do you trust this certificate? Click Trust to run this applet and allow it unrestricted access to your computer.

I trusted it anyway. Why? Mainly because it is on Sun’s site, and I doubt Sun was hacked. Second, because I clicked Show Certificate and it said everything was fine. Third, because on balance I think it is more likely that either Sun, Apple or a.n.other messed up either the cert or some other aspect of digital security programming, than that this particular bit of code belongs to a bad guy.

Nevertheless, I mention it because it illustrates the continuing hopeless state of Internet security. How on earth am I meant to know whether I should trust a certificate that “Java” has rejected? Who is this Java guy anyway? Why should I give any applet “unrestricted access” to my computer?

I see this all the time. We are confronted with impossible decisions, where one set of training tells us to click No – the certificate is out of date, the application is unsigned, the requested permissions are unwarranted – and another set of training tells us to click Yes – this is a reputable site, I need this installed to get on with my work, I’ve seen dialogs like this before and not come to any harm.

It might be better not to have the choice. In the scenario above, if the applet just refused to run, then there is a better chance that the problem would be treated as a bug and fixed. As it is, there is little chance that we will always guess right.

Technorati tags: , , ,

Adobe’s disappointing results, headcount reduction plans

Adobe has announced earnings slightly below its estimates. More worrying is its report of “weaker-than-expected demand for its new Creative Suite 4 family of products” and “steps to reduce its headcount by approximately 600 full-time positions globally”.

Is Adobe getting it wrong, or is this the effect of a weak global economy? I’d guess the latter; it may even be a good result in context. Adobe is dominating web video; Flash usage is still growing; there’s nothing out that that can compete with Photoshop; and there is a lot of interest in its Flex/Flash/AIR programming story. CS4 is a remarkable release; you can argue about some of the details (why is Soundbooth included instead of the superior Audition?) or grumble about the price (especially outside the USA), but there is a lot more right than wrong.

Even so, Adobe has a weakness in its business model. It makes its money on tools and server-side products, while giving away the runtimes like Flash player and Adobe reader. Could Adobe get into a Sun-like funk where everyone uses its technology, but the company itself gets relatively modest benefit? It is possible. You can do a lot with Flash and PDF without paying anything to Adobe. This is good for users, since even with high adoption of the runtimes, Adobe cannot sit back and watch the money roll in. It has to maintain the quality of its design and authoring tools, and it has to charge real money for them, because they are the heart of its business.

According to this document (PDF) Adobe’s business breaks down like this:

Revenue by segment ($millions) FY2008 YTD August 2008 – representing 3 quarters

  • Creative Solutions $1564.3
  • Business Productivity Solutions $786
  • Mobile and Device solutions $64.9
  • Other $249.4

I’m guessing a little; but I imagine that Creative Solutions is mostly Creative Suite, though it also includes Flash Media Server; and Business Productivity mostly Acrobat (authoring and server). Note that LiveCycle Data Services ES, which connects Flex to enterprise application servers, is part of Business Productivity, though Flex Builder is classified as Other. It seems that CS + Acrobat is where Adobe makes most of its money.

JavaFX code runs at the speed of Java

The Java runtime used by Sun’s JavaFX is mature and well optimized, which means that non-visual code will generally perform well. I’ve just spotted that Josh Marinacci at Sun put up a version of my countprimes test to illustrate this. Here’s the JavaFX version. On my system JavaFX and Silverlight are neck-and-neck for this – sometimes one is faster, sometimes the other. Flash is much slower, and Javascript not in the race.

Next stop: an Alchemy version.

Sun’s JavaFX is launched: another go at applets

Sun has launched JavaFX.

 
Sun’s Eric Klein, VP of Java Marketing, explains JavaFX

What is it? Sun says:

JavaFX is a rich client platform for building cross-device applications and content. Designed to enable easy creation and deployment of rich internet applications (RIAs) with immersive media and content, the JavaFX platform ensures that RIAs look and behave consistently across diverse form factors and devices.

What is it really? A new script language called JavaFX; a compiler that turns JavaFX script into Java bytecode; a runtime that includes new media codecs; converters that turn SVG, PhotoShop or Illustrator graphics into JavaFX format. JavaFX also requires the JRE (Java Runtime Environment). Currently only Windows and Mac OS X are supported; Linux and Solaris support “will be provided in a future release”; mobile is also on the way, promised for Spring 2009.

A variety of video and audio codecs are supported, but unfortunately these vary by platform. For example, WMV plays only on Windows; H.264 runs on Mac but on Windows only “as an update”, whatever that means. However, there is a specific “cross-platform” codec, which is VP6 from On2. Snag: you need On2’s commercial software to convert to the required .FXM format.

What’s good about JavaFX? Sun claims broadest market reach; but this is nonsense – I presume it is counting every device with a smidgen of Java installed. There are some advantages though. JavaFX can run Java code, and there’s plenty of that out there. The Java VM is mature and fast. A neat feature is that you can run JavaFX applications outside the browser by dragging them onto the desktop. Even in the browser, Java FX are not confined to the browser window, but can create graphics that appear anywhere on the screen. Java SE 6 update 10 or higher is required for these features, which depend on an out of process Java applet plugin in this update.

What’s bad about JavaFX? There are several reasons why Sun will find this a hard sell:

  • Large download size. Flash and Silverlight are self-contained browser plug-ins; Silverlight is larger than Flash, but still under 5MB. I’m not sure exactly what size JavaFX is on a machine without Java. I tried visiting javafx.com on a new XP install, and was directed to the main Java download site which recommended a JRE of about 7MB; I suspect it might do further incremental downloads after that, since the full JRE is more like 15MB. Once the JRE is in, you still need to install the JavaFX runtime, though is done automatically and I imagine that in time JavaFX will just be part of the JRE. Right now, the process is less smooth than for Flash or Silverlight.
  • Lack of design tools. Adobe has its fantastic Creative Suite, most of which now seems to target Flash. Microsoft has Expression. Sun is offering converters for Photoshop and Illustrator or SVG. These applications know nothing about JavaFX, and there is no visual editor in NetBeans 6.5.
  • A new language. Although JavaFX script does not look particularly difficult to learn, it is friction for developers wanting to give it a try.
  • Signs of haste. I’m seeing this now. When I saw the JavaFX announcement, I went to the site and successfully installed the runtime and played the introductory video, which itself uses JavaFX. Soon after, presumably as word spread, the launch site became unusable for me. Videos do not play; samples do not download. The spin will be that this shows the high level of interest; but vendors like Sun are meant to understand about scalability.

     
    JavaFX.com showing signs of stress on launch day

  • Late to the party. Adobe is well entrenched with Flash. If Microsoft is late with Silverlight, Sun is very late with JavaFX.
  • Limited features. I’m just back from Adobe MAX, learning about features like Pixel Bender in Flash Player 10, and its new text rendering engine, and new audio API. The JavaFX API looks limited by comparison. There is no 3D support yet.
  • Lack of compelling reasons for adoption. You can run Java code; but then again, Java applets and desktop Java clients have been around for many years. I can see the value in both Flash and Silverlight, but what is the must-have feature of JavaFX?
  • Platform variation. It bothers me that JavaFX supports different codecs on different platforms. What happened to write once – run everywhere?

What else? It’s early days. I’d like to hear from Designers whether JavaFX does what they need. JavaFX will improve, and it does have obvious value for Java developers who want to code rich internet applications. Sun’s commitment to open source may make JavaFX interesting to those who find Flash and Silverlight too tightly locked to single vendors.

Some details above are drawn from the JavaFX FAQ.

Adobe engineer: we gotta beat Silverlight

There was an amusing incident in the Flash Player Internals session this morning at Adobe MAX Milan. An attendee asked engineer Jim Corbett about what he said was a long-standing (10 years) Flash bug. Apparently, sprites sometimes tear as they move across the screen.

Corbett said he wasn’t familiar with the problem; but maybe it was a problem with the browser and that was why the bug had not been fixed.

Silverlight doesn’t have this problem, said the questioner.

Then we gotta fix it, said Corbett.

It reminded me how much I have heard Microsoft mentioned hear at Max. The Adobe execs make constant jibes at Microsoft; and are keen to emphasise wins like the BBC switching away from a Microsoft solution (not Silverlight) to Flash and AIR for its iPlayer.

It really is a war; and the winner for the time being is the user, as competition energises the development of these two Rich Internet Application platforms.

Why it’s hard to compete with Apple in mobile app development and deployment

One OS – one device – one AppStore – easy over-the-air purchase for end users. Apple’s development and deployment model delivers results, despite mutters about lock-in and Apple helping itself to a generous slice of the revenue.

Here at Adobe MAX Europe we’ve been hearing about the future of Flash on mobile devices and even seen a demo of what many would like to be able to do: simple over-the-air download of both the Flash runtime and Flash applications. Flash is a great runtime for a mobile device. A while back I reviewed the LG Viewty phone, which has a Flash UI, and despite some imperfections it convinced me of the potential of Flash for mobile devices.

Even so, it will be difficult for Adobe to create an application platform that works as well as Apple’s AppStore. Here are some of the problems.

  • Device-specific APIs. I spoke to the folk on the Sony Ericsson stand here at MAX. If you want your Flash application to do things like talking to the GPS, or integrating with the PIM (Personal Information Manager) on the phone, then you have to write a device-specific version of your Flash application. This adds to the development effort and creates friction in the deployment process. Will Adobe wrap device functions in Flash APIs? I asked about this at the press briefing today. The answer from Senior Principal Scientist Mark Anders was yes … maybe. He mentioned that API bloat became a negative for Java. It really is a difficult thing to get right.
  • Operator interference. Apple has bullied the operators it works with into doing things its way, and gets away with it because the device is so desirable. The operators though are reluctant to be no more than data carriers. They lock down devices, run their own application stores or music services, and make it difficult to mount a convincing challenge to Apple’s single store.
  • Diversity of devices. Diversity is good, sure. It’s tough for developers though. Maybe there’s a keyboard, maybe there is a touch screen, maybe there is a joypad, maybe the screen is big or small. Your app has to work well in every scenario, or else limit the number of devices it supports. Much easier with Apple, just one device to target. That will change somewhat as Apple bring out new iPhone variants, but there will always be more consistency from a single vendor.

It was similar factors that caused Microsoft to abandon its third-party vendors and create Zune, in an effort to compete with the iPod. Microsoft was too late. I am sure we will see increasing use of Flash and Flash-based applications on mobile devices; but it will be hard to displace Apple’s iPhone as the foremost mobile platform for downloaded applications.

Flash in the mobile browser is another matter, of course. If Apple continues to exclude Adobe’s runtime – which I guess it does to protect its application business – then it makes a nice selling point for competitors which do support Flash.

Amethyst from SapphireSteel: Develop Flex in Visual Studio, an alternative to Tofino

Not long ago I looked at an early preview of Ensemble’s Tofino, an extension to Visual Studio for developing Flex applications that target the Adobe Flash runtime. It was disappointing, though I’ve been assured that an improved build is in preparation. Ensemble had better be quick: I’ve just been informed of an alternative called Amethyst, from SapphireSteel software, creators of the Ruby Visual Studio extension Ruby in Steel. Here’s what I know so far about Amethyst:

  • ActionScript and MXML editing and project management
  • Installs into commercial editions of Visual Studio or the free Visual Studio shell
  • Initial beta of free personal edition available next week
  • Planned for the 2nd quarter of 2009: commercial Professional Edition with drag-and-drop Flex/AIR visual design environment, IntelliSense and graphical debugging tools
  • Can integrate with Ruby In Steel to create a multi-language Visual Studio solution with Flex at the front end and Rails at the back
  • Amethyst Personal will remain completely free

All sounds good; and Ruby in Steel is well-regarded so this is worth watching out for if you have any interest in developing for Flex in Visual Studio.

A high quality Visual Studio design tool for Flex would help Adobe gain adoption for Flex and AIR among Microsoft-platform developers.