As usual, there are some tools and SDKs which help the development tasks for maemo. This section introduces these facilities and describes how to install and use them.
As described in other sections, Scratchbox is a cross-compilation toolkit designed to make the development of embedded Linux applications easier. It provides a set of tools to integrate and cross-compile an entire Linux distribution. Scratchbox itself does not provide a graphical user interface for development but a simple command line for writing, debugging, and executing maemo applications.
Xephyr provides a graphical user interface where the device screen can be emulated. Using this tool, there is no need to copy the application to the device to see how it will appear. This tool is needed to launch the application framework and execute GUI applications.
In order to easily create or edit a file, use the following command from the text editor available in the SDK:
[sbox-SDK_X86: ~] > nano filename
The Nano text editor opens and you can enter text just as in, for example, Notepad.
If you are working on a machine with the Microsoft Windows Operating System, you have to emulate a Linux environment to be able to work with the maemo SDK. Setting up the SDK environment is described below.
The hardware and software requirements are as follows:
To emulate a Linux environment you need to setup the VMWare player, which is a virtual machine emulator where you will install and run the Maemo SDK environment.
To setup an up-to-date vmware image:
Download and install the latest version of the Windows OS-related VMware player.
Once you have installed the Virtual Machine program, go to Maemo SDK VMware Appliance and download the maemo-sdk-vmware (part 1) and the maemo-sdk-vmware (part 2) packages and store them in the same folder.
To decompress and install the SDK package:
Download and install the lastest version of 7-zip and use it to extract files from the maemo-sdk-vmware (part 1) package.
Hardware and software requirements:
Intel-compatible x86 processor, 500 MHz or faster
512 MB RAM or more (1 GB RAM recommended)
2 GB free hard-disk space.
Linux OS (Debian or Ubuntu are recommended, but other fairly recent distributions should also work).
Install and setup the maemo 4.0 development environment on your computer according to the steps described in Section "2.1 Installing Scratchbox using the new installer script" and Chapter "3. Installing Maemo 4.0 Beta SDK" in the INSTALL.txt file.
To run the maemo graphical environment you need an X server where to start it. The recommended server is Xephyr, but there are also other options. The X server is meant to be installed/run outside Scratchbox.
Xephyr is available in most Linux distributions. You can find Xephyr, for example, from: http://packages.debian.org/unstable/x11/xserver-xephyr.
On Debian-based Linux distributions, install the X server with
$ apt-get install xserver-xephyroutside Scratchbox.
Use the following parameters to start Xephyr outside Scratchbox:
$ Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac
$ /scratchbox/login
or simply
$ scratchbox
Now the prompted command line command is:
[sbox-SDK_X86: ~] >
This means that you are logged in to Scratchbox.
Once you have logged in and if you started Xephyr or another graphical window using display 2, as instructed earlier, set the DISPLAY variable inside Scratchbox to direct graphical applications to display 2.
[sbox-SDK_X86: ~] > export DISPLAY=:2
[sbox-SDK_X86: ~] > echo "export DISPLAY=:2" >> ~/.bashrc
Now that you have installed the maemo environment, ensure that your system is up to date and it gets the updated packages from the correct place.
To get the most recent C++ development packages, ensure that your system is using the correct packages repository. Log in to Scratchbox and do as follows:
[sbox-SDK_X86: ~] > fakeroot nano /etc/apt/sources.list
For Linux and Windows repositories:
deb http://repository.maemo.org/ diablo free non-free
deb-src http://repository.maemo.org/ diablo free
deb http://repository.maemo.org/extras/ diablo free
deb-src http://repository.maemo.org/extras/ diablo free
[sbox-SDK_X86: ~] > export http_proxy="http://address:port"
[sbox-SDK_X86: ~] > echo "export http_proxy="http://address:port" >> ~/.bashrc
[sbox-SDK_X86: ~] > fakeroot apt-get update
[sbox-SDK_X86: ~] > fakeroot apt-get -y upgrade
[sbox-SDK_X86: ~] > fakeroot apt-get -y install hildon-application-framework hildon-application-framework-dev
[sbox-SDK_X86: ~] > fakeroot apt-get install -y libhildonmm-dev libhildon-fmmm-dev
[sbox-SDK_X86: ~] > af-sb-init.sh startand the following user interface will appear on Xephyr:
[sbox-SDK_X86: ~] > af-sb-init.sh stop
Now you are ready to start developing your C++ GUI application.