Namespaces
Variants
Actions
Revision as of 11:47, 24 June 2011 by hamishwillee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Setting Predictive Text in WRT

Jump to: navigation, search


Article Metadata

Tested with
Devices(s): Nokia 5800 XpressMusic

Compatibility
Platform(s): S60 5th Edition

Platform Security
Capabilities: )

Article
Keywords: device.getServiceObject(), Service.SysInfo, Service.SysInfo.SetInfo()
Created: kiran10182 (25 Dec 2008)
Last edited: hamishwillee (24 Jun 2011)

Overview

This code snippet demonstrates how to set Predictive Text in a device by using the SystemInfo Service API of the Web Runtime (WRT) 1.1.

Note: The SystemInfo Service API for WRT 1.1 is only available from S60 5th Edition onwards.

Source file: index.html

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="basic.js"></script>
<script type="text/javascript" src="WRTKit/WRTKit.js"></script>
<style type="text/css">
@import url("basic.css");
</style>
</head>
<body onload="init()">
</body>
</html>

Source file: basic.js

var systemServiceObj = null;
 
// Called from the onload event handler to initialize the widget.
function init()
{
try
{
systemServiceObj = device.getServiceObject("Service.SysInfo", "ISysInfo");
}
catch (ex)
{
alert("System Service object cannot be found.");
return;
}
setPredictiveText();
}
 
// General Information
function setPredictiveText()
{
var on = {Status:1};
 
var setParameters = {Entity:"General", Key:"PredictiveText", SystemData:on};
try {
var result = systemServiceObj.ISysInfo.SetInfo(setParameters);
}
catch (ex)
{
alert(ex);
return;
}
alert("Predictive Text is set to on");
}

Postconditions

  • Sets Predictive text on in the device.

Supplementary material

77 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved