This is a quick start to develop Qt4 applications on the N810/Maemo.
For all practical purposes, N810 is a PC with a small screen - ARM processor,
Bluetooth, Wi-fi, speakers, USB connectible. Maemo is the platform that runs
on the device. Since Maemo is debian/linux, installing new software is a
breeze using apt. It uses Hildon as its UI framework (GTK). The OS versions
have fancy names - The lastest version is called Diablo (OS2008). The
previous version was called Chinook(2007?) and the one before that was called
Bora.
Let's first get Qt libraries installed on the device.
1. First flash the device to Diablo. Just follow instructions at
http://wiki.maemo.org/Upgrading_tablet_OS.
2. Settings->Application Manager is the UI for the package manager. It will
you to upgrade, if you didn't flash with the latest OS in step 1.
3. To develop and generally hack on the device, you need root previleges. The
best way to become root is by installing the ssh server.
- Enable maemo extras repository
(Application Manager menu->Tools->Application catalog).
- Install openssh sever. It will ask you for the root password.
- Install openssh client.
- Give root preveliges to normal user.
- There is a X Terminal under Utilities.
- ssh root@localhost
- In the X Terminal (under Utilities), 'EDITOR=vi visudo' and add the
following lines:
user ALL = (ALL) NOPASSWD: ALL
root ALL = (ALL) NOPASSWD: ALL
4. Install Qt as follows
- Edit /etc/apt/sources.list and add
deb http://repository.maemo.org/extras/ diablo free non-free
deb http://repository.maemo.org/extras-devel/ diablo free non-free
deb http://qt4.garage.maemo.org/ diablo extras
- apt-get update and apt-get install
5. That's it!
To develop Qt4 programs for the N810, we need
a) a simulator/environment to test our applications on a PC.
b) cross compile the application from our PC (x86->ARM)
Enter 'scratchbox'. The scratchbox environment uses qemu for processor emulation and
also provides the necessary cross compilation tool chain (from x86 to arm i.e).
Scratchbox is a 'virtual machine', you can logon to it, make changes, logout,
login again and you will find your changes (so its persistent). You can setup
Scratchbox to emulate x86 and the N810 ARM environment; Nokia provides N810 rootstraps
(images) for both these environments.
1. Install Scratchbox, Maemo sdk, Xephyr. Follow instructions at
http://tablets-dev.nokia.com/4.1/INSTALL.txt
- Installing Scratchbox takes a looong time with a slow internet connection
2. Switch to the scratchbox's ARM config. Make sure you can compile a simple
program in the scratchbox i.e printf("hello world\n").
- To transfer the program from scratchbox to the device, just use scp.
- scp is also useful to transfer existing source from your host to the scratchbox.
3. Install Qt development libraries on the scratchbox (headers, libs)
- Follow step 4 above, but now on the scratchbox.
- You should now have qmake et al.
4. Write simple Qt hello world
- You should be able to run it on the scratchbox and see it on Xephyr
* As mentioned in INSTALL.txt, start Xepyhr as
Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -extension Composite
* Setup DISPLAY environment variable in your scratchbox
- Transfer the Qt binary to N810 and it should work!
There's plenty of free stuff at http://maemo.org/downloads/OS2008/. One useful
utility is http://maemo.org/downloads/product/OS2008/screen-grabber/ to take
screenshots.
Happy hacking!