Easy. Short of.

I did this ‘experiment’ to test how much cross-platform Qt really is. I wanted to see if SocNetV can run on Maemo with no modifications whatsoever. These are the steps I followed:

1. Downloaded and installed the Xephyr X11 server (this is a small X11 server that runs inside ‘normal’ X and provides a virtual device screen where you see all the Maemo applications running):

sudo apt-get install xserver-xephyr

2. Downloaded and installed  Scratchbox and  Maemo SDK  in my laptop (Kubuntu x86/lucid).  I followed the straightforward instructions from the Maemo wiki and especially “Installing Maemo 5 SDK on x86-32 Debian based distribution“. It’s only seven steps and circa 100MBs of total downloads…

3. After installing the SDK, I started the Xephyr server with this command:

Xephyr :2 -host-cursor -screen 800x600x16 -dpi 96 -ac &

A nice but empty screen appeared. Rightly so, since I needed to start scratchbox and maemo UI.

4. I left the Xephyr window running and I opened a new konsole to Scratchbox by logging in:

[email protected]:~$ /scratchbox/login

A short welcome note appeared and then the scratchbox prompt:

[sbox-FREMANTLE_X86: ~] >

From there, I needed to export the display variable so that it matched the display where Xephyr was running:

[sbox-FREMANTLE_X86: ~] > export DISPLAY=:2

And then, I started the Maemo User Interface:

[sbox-FREMANTLE_X86: ~] > af-sb-init.sh start

At this point, the Xephyr window was displaying the familiar Maemo UI.

Initial Maemo UI

Initial Maemo UI

5. After the Maemo development environment was in place,  the only thing left for me was to install Qt4 development packages and copy socnetv trunk files. As you imagine, it’s all standard Debian commands:

[sbox-FREMANTLE_X86: ~] > fakeroot apt-get install libqt4-dev

6. After Qt4 was properly installed, I only needed to copy the SocNetV source files somewhere so that I can compile it inside Scratchbox. Piece of cake. Scratchbox creates a home user directory structure inside /scratchbox/users/your_username/home/your_username of the host machine. The contents of that directory are exposed to Maemo UI. So, from linux host, I just copied over the SocNetV source files to a subfolder.

[email protected]:~/socnetv$ cp -R trunk /scratchbox/users/dimitris/home/dimitris/

7. Finally, going back to the scratchbox console, I was ready to compile SocNetV for Maemo/Freemantle target. That was easy since qmake did all that was needed for me:

[sbox-FREMANTLE_X86: ~] > cd trunk/
[sbox-FREMANTLE_X86: ~/trunk] > qmake
[sbox-FREMANTLE_X86: ~/trunk] > make

8. That was all. After 2 minutes a new socnetv binary was ready for me to try out using the run-standalone command:

[sbox-FREMANTLE_X86: ~/trunk] > run-standalone.sh ./socnetv
SocNetV trunk running on Maemo/N900

SocNetV trunk running on Maemo/N900

Apparently, SocNetV runs pretty smoothly. Qt automagically uses Hildon styling and scales every UI element so that the application seem like a Maemo-native one. [Hint: in case you didn’t notice earlier I have tweaked the Xephyr startup command so that the Maemo window is 800X600 not 800X480 which is of course the N900 resolution :)]

Point-and-click creation of nodes and edges works, as well as the left-side toolbox. Most buttons and commands also work, and even Spring-Embedder plays nice.

But there are critical problems in the displaying of menus, since SocNetV is relying heavily on menu commands. There are too many menu entries which apparently cannot be displayed inside a window of only 480-pixel height.

Also, the toolbar is not working at all. You cannot open or save a network using the toolbar icons and, what is worse, no shortcut key combination works. 🙁

Okay. Not bad for a first attempt. After all, I didn’t modified a single line of code! 🙂

I am not sure how much work is needed for SocNetV to run smoothly on Maemo. Since I am a proud N900 owner I will take a look, though… Stay tuned for the 0.90 release, folks.