Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Revision as of 09:17, 24 June 2011 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to load System Info Service Object in WRT - A generic approach

From Wiki
Jump to: navigation, search

Article Metadata
Platform(s): S60 3rd Edition
Keywords: System Information Service (SysInfo)
Created: vasant21 (January, 4th, 2010)
Last edited: hamishwillee (24 Jun 2011)

  • There are some differences in WRT 1.0 and later version when we talk about using the systeminfo service object used to access a platform service. For eg: WRT 1.0 requires widgets to load the plug-in module explicitly by defining the following HTML code in their main HTML document:
<embed type="application/x-systeminfo-widget" hidden="yes"></embed>
  • While WRT 1.1 and later version provides an api for creating an object instance of a service interface.
nokia.device.load(interfaceName, version)

Loading Service Object - A Generic Way

  • Lets continue with the example case of systeminfo platform service
// so is declared as global variable
var so;
function load() {
// Lets check if running on WRT.
if ( typeof window.widget === 'undefined')
// Lets try getting SysInfo as ServiceObject
try {
so = window.device.getServiceObject("Service.SysInfo", "ISysInfo");
} catch (ex) {
// Embed SystemInfo plugin inside HTML For WRT 1.0.
so = document.createElement('embed');
so.setAttribute('type', 'application/x-systeminfo-widget');
This page was last modified on 24 June 2011, at 09:17.
40 page views in the last 30 days.