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 over the next few weeks. Thanks for all your past and future contributions.

Revision as of 04:38, 1 August 2012 by hamishwillee (Talk | contribs)

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

Archived:Checking for S60 Platform Services support in Symbian Web Runtime

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
Code ExampleTested with
Devices(s): Nokia 5800, S60 3rd Edition FP2 devices
Platform(s): S60 5th Edition (initial release), S60 3rd Edition FP2
S60 5th Edition
S60 3rd Edition FP2
Keywords: WRT widget S60 Platform Services JavaScript
Created: petrosoi (12 Oct 2008)
Last edited: hamishwillee (01 Aug 2012)



Access to device resources from a WRT widget via S60 Platform Services is currently only supported in S60 5th Edition.

Here's the code for a simple widget, checking the existence of the JavaScript device object extension.


S60 3rd Edition FP2 or S60 5th Edition emulator is needed for testing.

Widget HTML

<title>My Location Aware Widget</title>
<script type="text/javascript">
window.onload = function() {
var serviceObject;
serviceObject = device.getServiceObject("Service.Location", "ILocation");
if( == 'ReferenceError' )
alert('device object cannot be found');
var criteria = new Object();
var result = serviceObject.ILocation.GetLocation(criteria);
var latitude = result.ReturnValue.Latitude;
var longitude = result.ReturnValue.Longitude;
alert('Latitude= ' + latitude + '\nLongitude= ' + longitude);


If the device object exists, the widget pops up an alert box with the latitude and longitude acquired from the active positioning system on the device.

Otherwise an alert box with the text 'device object cannot be found' is shown to the user.

Please note that the GetLocation call used in this example is synchronous and may block your widget for a while, depending on the used positioning system. Check out the WRT Developer's Library for an example on calling the asynchronous version of the function.

You might want to install the simulation PSY to your device to remove the dependency to the availability of real positioning data.

Test application and other attachments (optional)

Please rename the .zip file to .wgz before attempting to install it on the emulator or a real device.

This page was last modified on 1 August 2012, at 04:38.
38 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.