Maemo Development – Getting Started

As complete beginner in programming Maemo devices, I was looking for an easy way to get started.  Currently C++ is the only officially supported language for Maemo development.  The Maemo SDK provides the tools and the Scratchbox sandbox environment.  Scratchbox is a fairly full-featured Linux development environment and includes tools like like gdb, valgrind, ltrace and strace.   Setting up the SDK is a fair amount of work. However, there is a pre-built virtual machine for VMware with the SDK and ESBox IDE all set up an ready to go.  Still, all this is not exactly a dive-right-in toolset.

Fortunately there is a simpler way – Python.  The N900 has Python 2.5.4 and Xterm,  vi and PyMaemo.  This provides all you need to get started. Just type in a program and you’re in business. Here’s the hello world app from the PyMaemo documentation

import gtk
import hildon

def hello(widget, data):
 print "Hello World!"

def main():
 program = hildon.Program.get_instance()

 window = hildon.Window()
 program.add_window(window)
 window.connect("delete_event", gtk.main_quit, None)

 button = hildon.Button(gtk.HILDON_SIZE_AUTO, hildon.BUTTON_ARRANGEMENT_VERTICAL, "Hello world!")
 button.connect("clicked", hello, None)
 window.add(button)

 window.show_all()
 gtk.main()

if __name__ == "__main__":
 main()

To run the Python program,  use this command at the shell prompt.

run-standalone.sh python2.5 helloworld.py

Now typing on the N900 keyboard isn’t realistic. The Komodo IDE I use on the Mac has the ability to edit remote files via scp. Once you install the OpenSSH server on the N900 you’re in a position to directly edit files on the device with Komodo.


Follow

Get every new post delivered to your Inbox.