This blog post has been written by Stimulant who worked with the early bits of Silverlight for Symbian. In this post, Josh Santangelo, Technical Director, Stimulant shares his experience working with early bits and some tips/tricks tuning the Bing application for small form factors.

Bing Application
Stock
Stories

Recently at MIX10, a project I’ve been working on for the last little while was announced. It’s a port of the news, weather, and stocks functionality from the Bing Toolbar to Silverlight running on Symbian smart phones.

A beta version of the runtime and information on how to build Silverlight apps for Symbian has been posted, and there’s an overview of the project over on the Stimulant site as well.

You can run the app on your regular desktop browser or on the device, though the proper fonts and layout will only appear on the device.

How it came together

When Microsoft approached Stimulant to build a mobile Bing experience for Symbian, we were pretty excited. We last worked with Silverlight on mobile back in 2008 with Silverlight 1 and Windows Mobile 6, so it was a treat to do it again with a real app and with real XAML and C# development.

Once the project was confirmed, we picked up a couple of Nokia N97 smart phones and got to work on designing a UI that maintained the feeling of the Bing toolbar, but with an experience that works better on the mobile platform. Microsoft provided some early bits of the Silverlight plug-in, and we found it to be relatively bug-free from the start — Silverlight 2 code pretty much “just worked” without any extra effort. When we did find issues, we had a direct line to the project team to report them.

We met with the Bing team to get a rundown on how the Bing Toolbar works. Large parts of it are implemented in Silverlight, and much of that code could be used in the mobile application as well. We crafted a mobile-appropriate UI around the data, but the routines that the toolbar uses for complex tasks like parsing feeds and generating stock charts worked flawlessly in the mobile runtime.

The development process went pretty smoothly. We built the application just like any other Silverlight app — in Visual Studio and Expression Blend. Most of the testing could be done on the desktop, with the only differences being that the correct fonts aren’t available on the desktop, and there is a large performance gap between the desktop and the device.

Tips and tricks

Getting started with Silverlight for Symbian is pretty straightforward, and well-documented in the Getting Started document. One thing that I’d add is to make sure you have the the latest Silverlight 2 developer runtime installed, rather than the Silverlight 3 runtime, in order to more accurately reproduce any issues between the desktop and the device. Be sure to turn off automatic updating of the runtime so that you don’t end up getting updated to a newer version.

We did not use the Symbian emulator, as it seemed fairly unstable, had somewhat different UI than the actual device, and wouldn’t show me the performance issues that the device has. We would very strongly recommend that all development and QA members of your team have access to a Nokia device on which to test your app.

Consider portrait and landscape orientations when designing and developing your application, because the user can change orientation by tilting the device. Handle the Application.Current.Host.Content.Resized event, and if Content.ActualWidth is greater than Content.ActualHeight, show a landscape version of your UI.

Instantiating elements from XAML is pretty expensive. We found that we got a better experience by creating all of the screens at start-up, waiting for them to do their first layout pass, and then collapsing them. When changing screens, the Bing app toggles the Visibility property of the various UI elements, and things come up pretty quickly.

The current batch of supported Symbian devices do not have GPUs — all rendering to the screen (except video playback) is done in software. This makes it very difficult to do any kind of animation. It also kills the possibility of responsive touch-driven UIs that require dragging or scrolling gestures. We implemented these types of features in the Bing app, but had to pull them for performance reasons. Hopefully we can put them back on the next version of the hardware.

One more obvious tip is to keep the size of your XAP as small as possible in order to get your application to start up quickly. If you have lots of bitmap graphics in your UI, consider loading them on-demand rather than as part of the XAP to reduce start-up time.

Finishing up

In general, our experience designing and developing for Silverlight for Symbian was very smooth and productive. We used our existing tools and processes, and ran into very few unexpected snags along the way, especially considering the runtime is in beta. We’re looking forward to working more with Silverlight on Symbian, so be sure to subscribe to the blog for more updates.

- Microsoft Silverlight for Symbian Team