Developing for Moblin 2.1
Moblin is a Linux-based platform for building operating systems and applications for mobile devices. For a developer, the important message here is that Moblin is Linux-based. Consequently, developing applications for Moblin is much like developing applications for any other Linux distribution: the full range of languages, frameworks and tools you'd use there are broadly applicable. Moblin devices typically also contain a web browser, which means that browser applications (online or offline) are another possibility.
However, Moblin devices usually have a small form factor and limited resources (low-powered processor, limited memory) which puts extra constraints on applications:
- The screen may be smaller than a full laptop or desktop computer, so applications have less screen real estate available.
- Applications need to be fast and responsive, not slow down boot times, and degrade gracefully if resources are scarce.
- Power management is vital, as these devices typically run disconnected from a power supply. This means that applications should minimise the load they place on the system.
So while standard Linux development is one possible approach, the above constraints make it difficult to build fast, lean and attractive applications with standard tools.
Moblin helps developers work effectively within these constraints by providing a set of libraries and services optimised for mobile devices, called Moblin Core. It provides the following facilities:
- App services
This layer sits over the kernel and device drivers, and provides hardware-agnostic APIs for managing networking (WiFi, WiMax, Bluetooth), power, GPS, audio, and other hardware. It also provides libraries which enable applications to integrate with existing generic Moblin services, such as:- bickley for managing multimedia metadata
- bognor-regis for managing multimedia play queues
- UI services
This layer provides libraries for developing fast, visually striking, animated user interfaces. Clutter and the Netbook Toolkit (nbtk) are the primary components in this layer:- Clutter is a facade over lower-level graphics libraries (OpenGL and OpenGL ES for embedded systems), simplifying use of those libraries for 2D and 3D graphics. Clutter is maintained as a standalone open source project at http://clutter-project.org/, but is deeply integrated into the Moblin Core.
- nbtk is an extension of Clutter which provides useful widgets (e.g. buttons, panels, labels) for GUI application developers.
While nbtk is one Clutter extension for building user interfaces, Clutter could be used as a basis for many other higher-level, use-model-specific toolkits: for example, you could build a custom UI toolkit for a specific class of device (e.g. a particular MID), using Clutter as a basis, and ignore nbtk altogether.
This diagram shows in more detail how the Moblin Core intermediates between the kernel and platform-specific UI layers.
By using these layers, a developer can ensure that their Moblin application provides the best experience for end users, and makes optimal use of the hardware underlying it.
At the moment, the most coherent approach for Moblin application development is to use the C programming language to interact with the Moblin Core APIs. While bindings exist for other languages (for example, Clutter has Ruby and Python bindings), the coverage of those bindings is inconsistent (some libraries have bindings, some don't). So for the moment, developing in C gives you the most consistent, coherent access to the full Moblin Core API.
One final point to note is that there are potentially massive differences between developing for different use models (netbook, MID, IVI), such as varying form factors and hardware capabilities (touch screen, GPS). However, this introductory guide only uses C libraries which are available on any device running Moblin Core, and should work across use models.
- Printer-friendly version
- Login or register to post comments