5 Tips and 4 and 1⁄2 Tricks for Porting GNOME Applications to Maemo Platform

Preview:

DESCRIPTION

Presention at 8th GUADEC, held in Birmingham, UK in 2007

Citation preview

5 tips and 4 and ½ tricks for porting GNOME applications

to Maemo platform

Eduardo Lima (Etrunko)8th GUADEC, Birmingham, UK

About INdT

● Instituto Nokia de Tecnologia● Founded by Nokia do Brasil● R&D for mobile devices● About 200 employees● Partnership with universities● Three main sites:

– Manaus– Brasilia– Recife

About INdT – Recife Site

● About 40 employees● Focused on OSS for mobile devices

– Nokia Internet Tablets (770 and N800)– S60 smartphones

● Some projects– Canola– Python for Maemo– Tapioca– Maemo Games– Maemo SDK VMWare/Qemu Appliances

– Carman– Mamona– Gmyth– Evas optimization

Why Porting Applications?

● GNOME is mobile as well

Other Reasons

● Bring new experiences to Maemo devices● Replacement of built-in applications● All advantages of FOSS

– New features implemented– Bug fixes and improvements– Community of users testing and reporting

bugs

● Yet another way to contribute to projects● “Don't reinvent the wheel!”

Some Restrictions

● Small screen (Good resolution)– Reduced usable area

● Processor power– 220 MHz (770)– 320 MHz (N800)

● RAM– 64 MB (770)– 128 MB (N800)– No swap (can be activated)

● DSP

Some (more) Restrictions

● Limited storage (JFFS2 helps)– 128 MB (770)– 256 MB (N800)

● No FPU in 770● Power consumption● Maemo patched libraries

– Old versions– Can't just be upgraded

● Scratchbox environment

First Steps

● Install scratchbox environment● Install Maemo SDK (i386 and armel)

– Bora for N800– Gregale for 770

● Find yourself a device (if possible)● Pick an application

– Study the code– Find the libraries it depends on

Feasibility Of The Port

● Check the dependencies– libbonobo/libbonoboui– libgnomeprint/libgnomeprintui– libgnome/libgnomeui– libgnomecanvas– gnomekeyring

● Processor power required● Storage required● Memory consumption

Getting Rid Of GNOME Stuff

● Some things can just be replaced– Help– Icon lookup

● Other things must go within #ifdef blocks– GnomeProgram– Session management– Synchronize accelerators

● Add configure checks for specific bits

Example: Gnumeric

It Works!

Brief Analysis Of The Screen

Great Resolution

Reduced Usable Area

Using The Virtual Keyboard

Using The Virtual Keyboard

Toolbar

Toolbar

Virtual Keyboard + Toolbar

Virtual Keyboard + Toolbar

And so on...

And so on...

Summary

● Use hildon stuff– Program/Window– Menu– Toolbars– Tap and hold– Dialogs (Open, Save, Fonts, Colors, etc)

● Hide anything else– Status bars– Other widgets

● Focus on the purpose of the application

Hildonization

● Replace the toplevel GtkWindow by a HildonWindow

● Get a HildonProgram instance● Add the HildonWindow to HildonProgram● Change GtkMenuBar to a regular

GtkMenu● Add GtkMenu to HildonWindow● Add GtkToolbar objects to HildonWindow● Add configure checks for Hildon libraries

How does it look like?

Other tips

● Set application name– g_set_application_name()

● Unset HildonWindow settings properties– gtk-button-images and gtk-menu-images

● Register the application with libosso– osso_initialize() and osso_deinitialize()– D-Bus service file (/usr/share/dbus-1/services)

● .desktop files go to another location– /usr/share/applications/hildon

Almost finished

● Build packages for everything– Both i386 and armel targets

● Test the packages in the device– Scratchbox armel emulation does not work

● Publish the packages, preferably by apt● Submit patches!

Challenges

● Dialogs usually are not developed taking small screens into account

● Reduce installation size– Documentation– Translations

● Debian packaging is boring● Acceptable performance

Other ports (Abiword)

Other ports (Evince)

Other ports (Gconf Editor)

Other ports (Rhythmbox)

Other ports (Leafpad)

Other ports (Xournal)

Thank You!eduardo.lima@indt.org.br

http://etrunko.blogspot.com

Recommended