×
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 (Automated change of category from Web Runtime (WRT) to Symbian Web Runtime)
hamishwillee (Talk | contribs)
m (Hamishwillee - Fix typo)
 
(8 intermediate revisions by one user not shown)
Line 1: Line 1:
__NOTOC__
+
[[Category:Symbian Web Runtime]][[Category:Code Examples]][[Category:Files/Data]][[Category:S60 5th Edition]]
__NOEDITSECTION__
+
{{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.
{{KBCS}}
+
 
{{CodeSnippet
+
{{ArticleMetaData <!-- v1.2 -->
|id=CS001406
+
|sourcecode= [[Media:MimeTypeHandling.zip]] [[Media:MimeTypeHandling.diff.zip]]
|platform=S60 5th Edition
+
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
|devices=Nokia 5800 XpressMusic
+
|devices= Nokia 5800 XpressMusic
|category=Web Runtime (WRT)
+
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
|subcategory=Files/Data
+
|platform= S60 5th Edition
|creationdate=June 8, 2009
+
|devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) -->
|keywords=device.getServiceObject(),Service.IAppManager.LaunchDoc(),
+
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
menu.setRightSoftkeyLabel(),widget.setNavigationEnabled(),
+
|signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
Service.IDataSource.GetList()
+
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= device.getServiceObject(),Service.IAppManager.LaunchDoc(),
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20090226
 +
|author= [[User:Ivruban]]
 +
<!-- The following are not in current metadata -->
 +
|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 70: Line 79:
 
==See also==
 
==See also==
  
* [[CS001245 - Loading images in WRT]]
+
* [[Loading images in Symbian Web Runtime]]
  
 
==Supplementary material==
 
==Supplementary material==
Line 79: Line 88:
 
* 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]].
 
* 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 general information on applying the patch, see [[Using Diffs]].
* For unpatched stub applications, see [[Example stub]].
+
* 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.
81 page views in the last 30 days.
×