×
Namespaces

Variants
Actions
(Difference between revisions)

MIME type handling in Symbian Web Runtime

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Fix metadata)
hamishwillee (Talk | contribs)
m (Hamishwillee - Fix typo)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 +
[[Category:Symbian Web Runtime]][[Category:Code Examples]][[Category:Files/Data]][[Category:S60 5th Edition]]
 +
{{Abstract|This code snippet demonstrates how to launch an application based on a given document using the AppManager Platform Service for Web Runtime}}. This service was introduced in S60 5th Edition. Image files were chosen to present the MIME type handling in WRT.
 +
 
{{ArticleMetaData <!-- v1.2 -->
 
{{ArticleMetaData <!-- v1.2 -->
 
|sourcecode= [[Media:MimeTypeHandling.zip]] [[Media:MimeTypeHandling.diff.zip]]
 
|sourcecode= [[Media:MimeTypeHandling.zip]] [[Media:MimeTypeHandling.diff.zip]]
Line 21: Line 24:
 
|author= [[User:Ivruban]]
 
|author= [[User:Ivruban]]
 
<!-- The following are not in current metadata -->
 
<!-- The following are not in current metadata -->
|subcategory= Files/Data
 
 
|id= CS001406
 
|id= CS001406
 
}}
 
}}
 
==Overview==
 
 
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==
 
==Source file: Relevant HTML components==
Line 91: Line 89:
 
* For general information on applying the patch, see [[Using Diffs]].
 
* For general information on applying the patch, see [[Using Diffs]].
 
* For unpatched stub applications, see [[Example app stubs with logging framework]].
 
* For unpatched stub applications, see [[Example app stubs with logging framework]].
 
[[Category:Symbian Web Runtime]][[Category:Code Examples]][[Category:Files/Data]][[Category:S60 5th Edition]][[Category:Code Snippet]]
 

Latest revision as of 09:01, 4 October 2012

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

Article Metadata
Code ExampleTested with
Devices(s): Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 5th Edition
S60 5th Edition
Article
Keywords: device.getServiceObject(),Service.IAppManager.LaunchDoc(),
Created: ivruban (26 Feb 2009)
Last edited: hamishwillee (04 Oct 2012)

Contents

[edit] Source file: Relevant HTML components

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

[edit] Source

/**
* 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);
return;
}
 
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
//application
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);
}
}
}
}

[edit] Postconditions

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

[edit] See also

[edit] 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.

This page was last modified on 4 October 2012, at 09:01.
156 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.

×