diff -r 4d198a32ac7d -r d4809db37847 plugins/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-E0ED671A-BBDA-4C07-828F-BD35782D9B36.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-E0ED671A-BBDA-4C07-828F-BD35782D9B36.html Thu Aug 19 17:48:04 2010 -0700 @@ -0,0 +1,91 @@ + + +Accessing +and modifying system information

Accessing +and modifying system information

+

The SystemInfo +Service API of WRT 1.1 allows widgets to +access and modify system information on a device. System information is represented +as a set of system attributes. You can use the SystemInfo Service to create widgets that:

+
    +
  • Read and modify system attribute values

  • +
  • Notify the user when system attribute values change

    +
  • +
+

The system attributes are grouped into the following categories:

+
    +
  • Battery

  • +
  • Connectivity

  • +
  • Device

  • +
  • Display

  • +
  • Features

  • +
  • General

  • +
  • Memory

  • +
  • Network

  • +
+

Only a few system attributes are modifiable and support change notifications. +For more information about system attributes, see section System attributes

+

Accessing the API and supported methods

+

To create a service +object for the SystemInfo Service API, use Service.SysInfo to +identify the service provider and ISysInfo to identify +the supported interface:

+ +
var so = device.getServiceObject("Service.SysInfo", "ISysInfo");
+

The ISysInfo interface provides the following methods:

+
    +
  • GetInfo()

    + +

    Use the GetInfo() method to retrieve information +about a system attribute.

    + +
  • +
  • SetInfo()

    + +

    Use the SetInfo() method to modify the value of +a system attribute.

    + +
  • +
  • GetNotification()

    + +

    Use the GetNotification() method to receive a notification +when the value of a system attribute is changed.

    + +
  • +
  • Cancel()

    + +

    Use the Cancel() method to cancel an ongoing asynchronous +call. This method is valid for any asynchronous call made through the SystemInfo +Service API.

    + +
  • +
+
+

Using the service in a widget

+

To access and modify system information using the SystemInfo Service +API:

+
    +
  1. Create a service +object for the API using device.getServiceObject().

    +
  2. +
  3. Define the +tasks you want to perform and choose the correct methods for them.

    +
  4. +
  5. Optionally, +define how you want the results filtered.

  6. +
  7. Define methods +to process the results.

  8. +
  9. Retrieve the +results using the methods from step 2. Use asynchronous methods together with callback().

    +
  10. +
  11. Process the +results using the methods defined in step 4.

  12. +
+

For the complete source of a sample widget that demonstrates how to +use this service, see the +full example.

+
+
\ No newline at end of file