Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Launching an installed application from Symbian Web Runtime

From Wiki
Jump to: navigation, search

This code snippet demonstrates how to launch an installed application from Symbian Web Runtime.

Article Metadata
Tested with
Devices(s): Nokia N96
Nokia 5800 XpressMusic
Platform(s): S60 3rd Edition, FP2
S60 5th Edition
Keywords: device.getServiceObject(), Service.AppManager, widget.openApplication()
Created: tapla (24 Oct 2008)
Last edited: hamishwillee (04 Oct 2012)



The snippet describes two approaches:

  1. Using the AppManager Service API of the Web Runtime.
  2. Using the openApplication method of the widget object.

The first approach is only available on devices that support S60 Platform Services. The second approach is available in every widget.

Note.pngNote: For security reasons, the second approach cannot be used to launch a widget. This restriction does not apply for the first approach.

Source: widget.xhtml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="StyleSheet" href="style/general.css" type="text/css" />
<script type="text/javascript" src="script/script.js" />
<title>WRT Application</title>
<div id="bodyContent" class="bodyContent">
<!-- When the button is clicked, launch the application with the
UID of 0x100058F8 (the Profiles application) -->
<input type="button" value="Launch" onclick="launchApp('0x100058F8');" />

Source: script.js

var serviceObj = null;
window.onload = init;
// Initializes the widget
function init() {
// Obtain the AppManager service object
try {
serviceObj = device.getServiceObject("Service.AppManager", "IAppManager");
} catch (ex) {
alert("Service object cannot be found.");
// Launches an application with the specified UID
function launchApp(uid) {
if (serviceObj != null) {
} else {
// Launches an application with the specified UID by using the platform service
// object (only available on 5th Edition devices)
function launchApp5thEd(uid) {
var criteria = new Object();
criteria.ApplicationID = "s60uid://" + uid;
var result = serviceObj.IAppManager.LaunchApp(criteria);
if (result.ErrorCode != 0) {
alert(result.ErrorCode + ": " + result.ErrorMessage);
// Launches an application with the specified UID by using the WRT widget
// object (available in every WRT device)
function launchApp3rdEd(uid) {
// The openApplication method requires that UID is an integer, not a string
uid = parseInt(uid);
widget.openApplication(uid, "");


The application with the specified UID (0x100058F8, the Profiles application) is launched.

See also

This page was last modified on 4 October 2012, at 05:30.
39 page views in the last 30 days.