(Difference between revisions)

MIME type handling in Symbian Web Runtime

From Nokia Developer Wiki
Jump to: navigation, search
copyeditor (Talk | contribs)
tanjaluodes (Talk | contribs)
Line 81: Line 81:
* For unpatched stub applications, see [[Example stub]].
* For unpatched stub applications, see [[Example stub]].
[[Category:Web Runtime (WRT)]][[Category:Code Examples]][[Category:Files/Data]][[Category:S60 5th Edition]]
[[Category:Web Runtime (WRT)]][[Category:Code Examples]][[Category:Files/Data]][[Category:S60 5th Edition]][[Category:Code Snippet]]

Revision as of 14:15, 15 January 2010


Article Metadata
Tested with
Devices(s): Nokia 5800 XpressMusic
Platform(s): S60 5th Edition
S60 5th Edition
Keywords: device.getServiceObject(),Service.IAppManager.LaunchDoc(),


Created: (08 Jun 2009)
Last edited: tanjaluodes (15 Jan 2010)


This code snippet demonstrates how to launch an application based on a given document using the AppManager Platform Service for Web Runtime, introduced in S60 5th Edition. Image files were chosen to present the MIME type handling in WRT.

Source file: Relevant HTML components

<select size = "5" id = "imageList" onclick = "show();">


* Shows the selected image.

function show() {
var so = null;
try {
//Getting service object for application management.
var so = device.getServiceObject("Service.AppManager", "IAppManager");
} catch (ex) {
alert("Exception in getting application service object: " + ex);
var imageList = document.getElementById("imageList");
for (var i = 0; i < imageList.options.length; i++) {
if (imageList.options[i].selected) {
var criteria = new Object();
criteria.Document = new Object();
//Setting the path to file that must be opened in a standalone
criteria.Document.DocumentPath = imageList.options[i].value;
//Opening the file in standalone application
try {
var res = so.IAppManager.LaunchDoc(criteria);
if (res.ErrorCode != 0){
alert(res.ErrorCode + ' ; ' + res.ErrorMessage);
} catch (ex){
alert("Exception in launching document: " + ex);


The image selected from the list is displayed in a standalone application.

See also

Supplementary material

This code snippet is part of the stub concept, which means that it has been patched on top of a template application in order to be more useful to developers. The version of the WRT stub application used as a template in this snippet is v1.1.

  • The patched, executable application that can be used to test the features described in this snippet is available for download at Media:MimeTypeHandling.zip.
  • You can view all the changes that are required to implement the above-mentioned features. The changes are provided in unified diff and colour-coded diff (HTML) formats in Media:MimeTypeHandling.diff.zip.
  • For general information on applying the patch, see Using Diffs.
  • For unpatched stub applications, see Example stub.
125 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.