diff -r 913c9751c067 -r 716254ccbcc0 org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-2240F5BE-97BD-4CB3-8DB3-B5CF7C23BF54.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-2240F5BE-97BD-4CB3-8DB3-B5CF7C23BF54.html Fri Mar 05 19:11:15 2010 -0800 @@ -0,0 +1,96 @@ + + +Accessing +messages and using messaging services

Accessing +messages and using messaging services

+

The Messaging +Service API allows widgets to send, retrieve, and manage +messages using the Messaging Center of a device. You can use the Messaging +Service to create widgets that:

+
    +
  • Send SMS and MMS messages

  • +
  • Retrieve messages stored on the device

  • +
  • Notify the user when new messages arrive

  • +
  • Change the status of a message

  • +
  • Delete messages

  • +
+

Accessing the API and supported methods

+

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

+ +
var so = device.getServiceObject("Service.Messasing", "IMessaging");
+

The IMessaging interface provides the following +methods:

+
    +
  • GetList()

    + +

    Use the GetList() method to retrieve messages stored +in the Messaging Center of a device.

    + +
  • +
  • Send()

    + +

    Use the Send() method to send an SMS or MMS message.

    + +
  • +
  • RegisterNotification()

    + +

    Use the RegisterNotification() method to receive +notifications of new incoming messages.

    + +
  • +
  • CancelNotification()

    + +

    Use the CancelNotification() method to cancel notification +of new incoming messages.

    + +
  • +
  • ChangeStatus()

    + +

    Use the ChangeStatus() method to change the read +status of a message.

    + +
  • +
  • Delete()

    + +

    Use the Delete() method to delete a message.

    + +
  • +
  • Cancel()

    + +

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

    + +
  • +
+
+

Using the service in a widget

+

To perform messaging tasks using the Messaging Service API:

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

    +
  2. +
  3. Define the +messaging 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. Use the methods +defined in step 2 to perform the messaging tasks. Use asynchronous methods +together with callback().

    +
  10. +
  11. Process the +results in 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