How-to use systeminfo API in WRT widgets
hamishwillee
(Talk | contribs) m (test) |
hamishwillee
(Talk | contribs) m (Replace CodeSnippet with ArticleMetaData template (testing)) |
||
| Line 1: | Line 1: | ||
[[Category:Symbian Web Runtime]][[Category:Symbian Web Runtime]] | [[Category:Symbian Web Runtime]][[Category:Symbian Web Runtime]] | ||
__NOEDITSECTION__ | __NOEDITSECTION__ | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
{{ArticleMetaData | {{ArticleMetaData | ||
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | |sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | ||
| Line 23: | Line 12: | ||
|keywords= System Information API , sysinfo, WRT 1.0, Platform Services 1.0 | |keywords= System Information API , sysinfo, WRT 1.0, Platform Services 1.0 | ||
|id= <!-- Id for article (Knowledge base articles only) --> | |id= <!-- Id for article (Knowledge base articles only) --> | ||
| + | |creationdate=October 3, 2007 | ||
| + | |author=[[User:forum-mrkt]] | ||
}} | }} | ||
Revision as of 08:17, 25 May 2011
Article Metadata
Compatibility
Platform(s): S60, WRT 1.0, Platform Services 1.0
Platform Security
Signing Required: Not required
Article
Keywords: System Information API , sysinfo, WRT 1.0, Platform Services 1.0
Created: forum-mrkt
(03 Oct 2007)
Last edited: hamishwillee
(25 May 2011)
Defining HTML
To enable system info API in widgets it needs to be embedded in the document since it is implemented as a netscape scriptable plug-in.
<embed type="application/x-systeminfo-widget" hidden="yes"></embed>
HTML example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript" src="api.js" />
<body onload="testapi()">
<embed type="application/x-systeminfo-widget" hidden="yes"></embed>
</body>
</html>
JavaScript
- Lets use the [void] sysinfo.beep(Int frequency, Int duration) api as an example : It produces a beep tone in a specified frequency for a specified duration.
function testapi()
// First lets get the reference to the sysinfo object.
var sysinfo = document.embeds[0];
//
sysinfo.beep(5000, 900);
};

