How-to use systeminfo API in WRT widgets
hamishwillee
(Talk | contribs) m (Hamishwillee - Fix categories) |
|||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | [[Category: | + | [[Category:Symbian Web Runtime]][[Category:Code Examples]][[Category:How To]][[Category:Base/System]] |
| + | __NOEDITSECTION__ | ||
| + | {{ArticleMetaData | ||
| + | |sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | ||
| + | |installfile= <!-- Link to SIS (or WGZ etc.) installation file (e.g. [[Media:The Installation File.sis]]) --> | ||
| + | |devices= <!-- Devices tested against (e.g. ''devices=N95, N8'') --> | ||
| + | |sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) --> | ||
| + | |platform= S60, WRT 1.0, Platform Services 1.0 <!-- Compatible platforms (e.g. ''Symbian^1 and later, Qt 4.6 and later'') --> | ||
| + | |devicecompatability= <!-- Compatible devices (e.g.: ''All* (must have internal GPS)'' ) --> | ||
| + | |signing=Not required | ||
| + | |capabilities=<!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. --> | ||
| + | |keywords= System Information API , sysinfo, WRT 1.0, Platform Services 1.0 | ||
| + | |id= <!-- Id for article (Knowledge base articles only) --> | ||
| + | |creationdate=October 3, 2007 | ||
| + | |author=[[User:forum-mrkt]] | ||
| + | }} | ||
| − | + | == Defining HTML == | |
| − | + | ||
| − | + | ||
| − | == 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. | 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. | ||
| − | <code> | + | <code javascript> |
<embed type="application/x-systeminfo-widget" hidden="yes"></embed> | <embed type="application/x-systeminfo-widget" hidden="yes"></embed> | ||
</code> | </code> | ||
| Line 13: | Line 25: | ||
HTML example | HTML example | ||
| − | <code> | + | <code javascript> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | ||
"http://www.w3.org/TR/html4/strict.dtd"> | "http://www.w3.org/TR/html4/strict.dtd"> | ||
| Line 27: | Line 39: | ||
== JavaScript == | == JavaScript == | ||
| − | <code> | + | |
| + | * 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. | ||
| + | |||
| + | <code javascript> | ||
function testapi() | function testapi() | ||
| + | // First lets get the reference to the sysinfo object. | ||
var sysinfo = document.embeds[0]; | var sysinfo = document.embeds[0]; | ||
| + | // | ||
sysinfo.beep(5000, 900); | sysinfo.beep(5000, 900); | ||
| − | } | + | }; |
</code> | </code> | ||
| + | <!-- Translation --> [[ja:Web Runtime WidgetsでSysteminfo APIを使用する方法]] | ||
Latest revision as of 09:03, 10 October 2012
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
(10 Oct 2012)
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);
};

