Maemo system services

Important System Services
The underlying system services in the maemo platform differ slightly from those of
used in desktop Linux distributions. This chapter gives an overview of the most important
system services.
5.1 File system - GnomeVFS
Maemo includes a powerful file system framework GnomeVFS. This framework enables
applications to use a vast number of different file access protocols without having
to know anything about the underlying details. Some examples of the supported protocols
are: local file system, HTTP, FTP and OBEX over Bluetooth.
In practice this means that all GnomeVFS file access methods are transparently
available for both developer and end-user just by using the framework for file operations.
The API for file handling is also much more flexible than the standard platform
offerings. It features for example asynchronous reading and writing, MIME type support
and file monitoring.
All user-file access should be done with GnomeVFS in maemo applications because
file accesses can be remote. In fact many applications that come with the operating
system on the internet tablets do make use of GnomeVFS. Access to files not
visible to the user should be done directly for performance reasons.
A good hands-on starting point is taking a look of the GnomeVFS example
in maemo-examples package. Detailed API information can be found from the
GnomeVFS API reference[18].
5.2 Application Preferences - GConf
GConf is used by the GNOME desktop environment for storing shared configuration
settings for the desktop and applications. The daemon process GConfd follows the
changes in the database. When a change occurs in the database, the daemon applies the
new settings to the applications using them. For example, the control panel application
uses GConf.
If setting are used only by a single application, Glib utility for .ini style files should
be used instead. Applications should naturally have working default settings. Settings
should be saved only when the user changes them.

5.3 D-Bus
For interprocess communications (IPC), maemo relies heavily on D-Bus. D-Bus makes
it possible for programs to export their programming interfaces so that other processes
can call them in consistent manner without having to define a custom IPC protocol. Using
these exported APIs is also language agnostic, so as long as programming language
supports D-Bus, it can also access the interfaces.
A maemo specific library called libosso provides helpful wrappers for D-BUS communication.
It also contains required functionality for every maemo application. Applications
must be initialized using this library. With it applications can connect to
listen to system hardware state messages such as ”battery low”. The library is used
also for application state saving and auto-save functionality. The maemo tutorial[36]
provides a good introduction to libosso.
5.4 Other system services
Maemo platform provides many libraries and APIs for different common tasks. Alarm
framework and GPS API are described here, other relevant services are described later
in this document.
5.4.1 Alarm Framework
The Alarm framework included in maemo gives developers an easy to use an interface
for working with all kinds of timed events. It provides a consistent user interface, audio
playing, starting the device, sending a D-BUS signal or executing a file and more. The
document Using Alarm Interface[73] describes the framework in detail.
5.4.2 GPS API
The GPS framework in maemo consists of a GPS daemon and a library for controlling
it. The maemo connectivity guide[41] gives examples how to use the library in
applications.


No comments: