Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference

Qtopia Application Services

Introduction

Application Services are standardized APIs to functionality supplied by applications. They allow applications to invoke the services of other applications, while allowing the specific application providing the service to be selected by the system integrator or end-user.

Requesting Services

To request a service, the calling application executes:

    ServiceRequest srv(servicename, action);
    srv << parameters;
    srv.send();

For example:

    ServiceRequest srv("Email", "writeMail(QString,QString)");
    srv << QString("Johan R. User") << QString("random@trolltech.com");
    srv.send();

ServiceRequest::send() returns a bool value indicating whether the service is available.

Responding to Service Requests

To respond to a service request, an application should connect to the QPEApplication::appMessage() signal.

Applications register as providing a service by supplying a standard Qtopia configuration file, $QPEDIR/services// where:

The standard keys in this file are:

The file may contain any additional sections, keys and values as defined by the documentation of the service.

Adding a New Service

Each service must be carefully specified as it provides a system- wide API that can be invoked by other applications and the user. A service should only be added if it:

To add a new service provide a standard Qtopia configuration file, $QPEDIR/services/<servicename>.service The keys in this file are:

For example:

[Translation]
File=QtopiaServices
Context=Calendar
[Service]
Actions = raiseToday();newEvent()
Icon = datebook_icon
Name[]=Calendar
[newEvent()]
Icon = datebook_icon
Name[]=New event
[raiseToday()]
Icon=today
Name[]=Today's calendar

Usually, only one application responds to a given service. The user selects which application handles the service using the Application Services settings. If the service can be provided by multiple applications, the service file will contain:

Multiple = 1
in the [Service] section.

Advanced Service Functionality

The servicename of a service may contain '/', indicating that the service is actually an hierarchy of services. For example, the SetValue/v-card service is used to set v-card values, but the service is structured such that other SetValue services follow the same general protocol.

Pre-Defined Services

This section defines the Trolltech basic services available on a Qtopia device:

Each of the basic services responds to the following messages:

Note: Sending the quit() message when a service is not started will start the service and immediately terminate it.

A list of services ordered by message name is available at: Service Overview and the following additional services are described in the sections below:

Document-Oriented Services

The following actions are defined for document- oriented services:

WebAccess Services

WAP Push and Over-The-Air (OTA) Services

The following actions are defined for WAP Push and Over-The-Air (OTA) > Services:

WAP push services are registered by either MIME type or port number.

MIME type services are named Push/T where T is the MIME type. For example, messages of type application/vnd.wap.connectivity-wbxml are handled by a service called Push/application/vnd.wap.connectivity-wbxml.

Port number services are named smsapp/N where N is the port number in decimal.


Copyright © 2005 Trolltech Trademarks
Qtopia version 2.2.0