次の方法で共有


Getting Started with Silverlight for Symbian

Microsoft Silverlight will reach end of support after October 2021. Learn more.

This topic provides step-by-step information for getting started developing Silverlight-based applications. It includes information about the requirements and package components, and how to create a basic project in Visual Studio.

Silverlight for Symbian includes a runtime that is optimized to display content on memory-constrained devices. Silverlight support for Nokia S60 5th Edition devices includes the following:

  • The ability to view Silverlight-based applications in the mobile browser.

  • Tools to create Silverlight-based applications that target devices.

You can create Silverlight-based applications for devices by using Expression Blend 2 (free trial version), Visual Web Developer 2008 Express Edition with SP1, or Visual Studio 2008 SP1 with Silverlight Tools for Visual Studio 2008 SP1. Other versions of Expression Blend and Visual Studio are not supported. Application deployment on Internet Information Services (IIS) or a comparable web server such as Apache is supported.

The installable executable file for Silverlight for Symbian includes the Silverlight runtime for Symbian for the emulator, and sample applications. This topic provides the following information:

  • Prerequisites

  • Obtaining and Installing Microsoft Silverlight for Symbian Developer Tools

  • Installing an S60 Emulator with the Silverlight Runtime

  • Installing the Silverlight Runtime on an S60 Device

  • How to Run Samples on an S60 Emulator

  • How to Create a Silverlight Application for S60

  • Help Documentation

  • Next Steps

Prerequisites

Supported Platforms

The Silverlight runtime for Symbian is hosted only in the S60 default WebKit-based browser.

All Nokia S60 5th Edition devices are supported, including the following:

  • Nokia 5800 XpressMusic

  • Nokia N97

  • Nokia N97 mini

  • S60 5th Edition SDK 1.0 Emulator

Supported Browsers

The Nokia S60 browser is based on WebKit. Browser versions 7.1.xxx are supported. However, for optimal performance and bug fixes, version 7.2.xxx is recommended.

Browser version 7.2.xxx will be available with the next firmware update. To determine the browser version on Nokia N97, open the browser and click Options, Help, and then About Application. A value similar to the following is displayed: About Application BrowserNG/7.1.18124.

Supported Development Languages

C# is the only language that is supported for Silverlight application development on devices.

NoteNote:

Visual Basic is not supported in the current release.

Silverlight for Symbian allows you to create Silverlight 2 sites. JavaScript is not supported because of browser limitations. Although some JavaScript features work, Silverlight 1 sites that use JavaScript are not supported. Silverlight 1 sites that use only XAML are supported.

The dynamic language runtime (DLR) is not supported on devices. IronPython, IronRuby, and managed JScript, which require the DLR, are not supported.

Obtaining and Installing Microsoft Silverlight for Symbian Developer Tools

Silverlight for Symbian is delivered in two formats: an installable binary file (.sisx format) that users can download over the web to run Silverlight applications, and an installable setup package for development. Both are available on the Microsoft Download Center. Silverlight for Symbian is not part of the ROM of any of the supported devices. This section describes installation of the developer tools and the package contents.

To install Microsoft Silverlight for Symbian Developer Tools for development, double-click the setup file, and follow the installation instructions.

Package Contents

The package contains the following components:

  • Silverlight runtime for S60 5th Edition emulator. This is a command file that installs and uninstalls the runtime on the emulator. The file, called InstS60Emu.cmd, is located in installation folder\Redist\Emulator\.

  • Sample applications. These are sample applications with source code. They are located in installation folder\Samples.

    The following samples are included:

    • Digg. This is a Silverlight 2–based application. It includes Visual Studio 2008 project files and C# source code.

    • Hello World. This is a Silverlight 2–based application. It includes Visual Studio 2008 project files and C# source code.

    • SilverPlayer. This is a Silverlight 2–based application. It includes Visual Studio 2008 project files and C# source code. This application can be used as a template for other media applications.

  • Silverlight for Symbian Help documentation. This .chm file is located in installation folder\Docs. To obtain the combined Silverlight 2 and Silverlight for Symbian Help documentation, download the Silverlight for Symbian Developer Tools Documentation.

For a list of Silverlight 2 features that are supported on Nokia S60, see Platform Limitations on Nokia S60.

Installing an S60 Emulator with the Silverlight Runtime

The following procedure describes how to install an S60 emulator together with the Silverlight runtime.

To install an S60 emulator with the Silverlight runtime

  1. Install Java Runtime 1.6.0 or later, using the default options. Install from the Java website.

  2. Install ActivePerl 5.6.1, build 635 or later, using the default options. Install from the ActiveState website.

  3. Install Nokia S60 5th Edition SDK. To install, go to the Forum.Nokia.com website and click 5th Edition in the drop-down list. Only the Emulator option must be selected during installation. The other choices are optional.

  4. Run the emulator installer included in this release.

    • Open a command prompt and navigate to installation folder\Redist\Emulator.

    • Run the command InstS60Emu.cmdS60 SDK root directory. The following line shows an example:

      InstS60Emu.cmd D:\S60\devices\S60_5th_Edition_SDK_v1.0.

    NoteNote:

    To uninstall, run InstS60Emu.cmd –uninstallS60 SDK root directory.

Installing the Silverlight Runtime on an S60 Device

The .sisx installer is Symbian Signed and can be installed on a device without the need for provisioning. A user can use the browser on a device to download and save the runtime on the device, and then install it.

To install the runtime on a device by using the browser

  1. Open the browser and navigate to a website created for Nokia S60 devices that use Silverlight for Symbian.

  2. Click the Get Microsoft Silverlight image.

    This downloads the .sisx file, and automatic installation begins.

  3. Restart the browser, and visit a site created for Nokia S60 devices.

To install the runtime on a device from your development computer

  • After installing the Microsoft Silverlight for Symbian Developer Tools, download the Silverlight for Symbian runtime, and run the .sisx installer from Nokia PC Suite.

    - or -

  • Copy the .sisx installer to the device and install from the device.

How to Run Samples on an S60 Emulator

The following procedure shows how to run the samples on an S60 emulator.

To run samples on an S60 emulator

  1. Start the emulator.

    To start the emulator, click Start, point to S60 Developer Tools, and then click Emulator.

  2. In the Emulator window, on the File menu, click Open URL, or press CTRL+U.

  3. In the Open URL dialog box, type the URL of the page that contains the sample, and then click OK.

How to Create a Silverlight-Based Application for S60

The following procedure shows how to create a Silverlight-based application for S60.

To create a Silverlight-based application for S60

  1. Install the required development tools.

  2. Create the application.

    Create the Silverlight-based application by using Expression Blend 2, Visual Studio, or Visual Web Developer. Become familiar with the S60 limitations described in Platform Limitations on Nokia S60. For information about developing Silverlight-based applications, see the Microsoft Silverlight website.

  3. If you are using S60 browser version 7.1.xxx, you must modify the HTML file.

    You must modify the generated HTML file that embeds the <object> tag. This is required because of a limitation with the S60 web browser. Open the generated HTML file in the Code Editor and change

    <object data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%">
        <param name="source" value="someApplicationName.xap"/>
    

    to

    <object data="some_valid_data" type="application/x-silverlight-2" width="100%" height="100%">
        <param name="source" value=" someApplicationName.xap"/>
    

    The data parameter value of the <object> tag should be modified to a valid resource that the browser can download by using HTTP. The resource can be an empty file of size equal to zero bytes. A few examples of valid data values include the following:

    • data="someApplicationName.xap"

    • data="ZeroByteFile.xap"

    NoteNote:

    This issue is fixed in S60 browser version 7.2.xxx, and no modifications are required.

  4. To run the application on the emulator, remove the default anchor tag.

    You must remove the default anchor tag <a href="" /> or the application will fail to load on the S60 emulator. The code containing the default anchor tag is shown here.

    <object data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%">
        <param name="source" value="HelloWorld.xap"/>
        <param name="onerror" value="onSilverlightError" />
        <param name="background" value="white" />
        <param name="minRuntimeVersion" value="2.0.31005.0" />
        <param name="autoUpgrade" value="true" />
        <a href=https://go.microsoft.com/fwlink/?LinkID=124807
            style="text-decoration: none;">
        <img src=https://go.microsoft.com/fwlink/?LinkId=108181
            alt="Get Microsoft Silverlight" style="border-style: none"/>
        </a>
    </object>
    
  5. Test the application.

    Deploy the Silverlight-based application to a web server and then start the emulator. On the File menu, click Open URL (or press CTRL+U) to go to the URL of the Silverlight-based application.

    Supported web servers include IIS or a comparable web server such as Apache.

    NoteNote:

    If you open a Silverlight-based application directly from a file folder, network calls in the application will fail.

Documentation

If you have not already downloaded the documentation, download the Silverlight for Symbian Developer Tools Documentation. This download contains the Silverlight for Symbian documentation and the associated Silverlight 2 documentation. The Silverlight 2 documentation does not include information about Silverlight for Symbian.

Silverlight for Symbian supports a subset of the Silverlight 2 features that are described in the SDK. You can use the Object Browser in Visual Studio to view the types and members that are present in the mobile assemblies for Nokia devices. In the Object Browser, click Custom Component Set in the Browse box, and then click the Edit Custom Component Set button (). On the Browse tab, navigate to the assemblies that are used by the emulator in the following directory: emulator installation folder\epoc32\winscw\c\system\silverlight.

Some types or members that are present in the assemblies may not be supported. For detailed information, see Platform Limitations on Nokia S60 and Class Library Support on Nokia S60.

Next Steps

For help with getting started with Silverlight development, see the "Getting Started" topics for Silverlight 2 in the Silverlight for Symbian Developer Tools Documentation.

For information about debugging applications in Silverlight for Symbian, see Debugging for Nokia S60.

To develop media applications in Silverlight for Symbian, see Media on Nokia S60.

See Also

Other Resources