Python on a Symbian-based Nokia S60 smartphone PDF Print E-mail
User Rating: / 0
News - Web Development
Written by Tim Black   
Monday, 31 December 2007 13:07

Over Thanksgiving I wrote a little program in JavaScript for my Dad, who is a charter pilot who needs an easy way to record several time values with the press of one button on his smart phone:

  • engine start
  • takeoff
  • landing
  • engine shutdown

It works great, except Opera doesn't allow files opened from the local filesystem to store cookies, and Dad doesn't always have web access when he needs to record a time value.  (Maybe I should try an Opera Widget...)  So, in the spirit of the Do-It-Yourself books he's got on his bookshelf, over Christmas Dad asked me what language I'd recommend he use to write a program for his phone.

If I knew how to use Google Gears on the Nokia S60, maybe I'd recommend it.  But I don't and I wonder if Gears is still too new.  So after a little research, here's what I came up with:

It looks to me like C++ is the default language to use on Symbian, and Java is a close second.  However, I wouldn't use either myself, because the syntax of both C++ and Java (see Executive Summary, short code comparison and long code comparison) (and development process--you have to compile for your particular operating system before you run) is more complex than Python's (and I already use Python), and Python works on Symbian.  It is my impression that Python programs are also more portable to other operating systems than are C++ programs.  For these reasons, it looks like Symbian development is moving toward using Python and Ruby.  There are several Python libraries available that you can "import" into your Python code to create the application's GUI features (title, menu, central content including buttons, text boxes, pictures, etc.).  They work by providing a Python interface to Symbian's software development kits - SDKs (see S60 SDKs) including Symbian's graphical user interface (GUI) libraries and other available functionality (contacts, calendar, filesystem, phone, etc.).

I'd also consider using an integrated development environment (IDE) specifically designed for creating GUI programs on Symbian, because an IDE can give you a layout editor that lets you create the program by dragging and dropping GUI widgets (buttons, text boxes, etc.) into your program and then writing code to respond to widget events (mouse clicks, character presses, etc.).  One Symbian C++ IDE is Carbide, a set of extensions to the Eclipse IDE.  It appears there isn't a Symbian GUI IDE yet for Python or Ruby.

So to summarize, here's what I would use, in the order they would need to be installed on your computer:

Python interpreter
Use the latest version of Python 2.5, unless you find that the other tools below are only compatible with an earlier version of Python, in which case, install the earlier version.

SDK  A package containing a Python interface to a Symbian SDK and related tools:
PyS60 (seems to be the
best & most current)  Python for S60 seems to be an older version of the same, see its helpful wiki
Python for UIQ (out of date)

Simple:  IDLE, which comes with Python & is included in PyS60
More full-featured: 
Boa Constructor (requires wxPython) (I recommend installing TortoiseCVS first to install the most recent version of Boa Constructor)

Essential background reference material
Introduction to Programming:  Beginner's Guide to Python
Introduction to Python syntax:  Dive into Python
Python Tutorial
Python Library Reference -- (ActivePython's had nicer formatting at one point)
Python Quick Reference Guide

If one exists, it's a good idea to use a book as a guide to how to program on the S60 in your chosen language.  The only one I can find for Python is Mobile Python, and it looks to be exactly what you would want.  I might start with the author's tutorial instead.

Other stuff
Code snippets
Here are some tools for making it easier to test your Python code on the phone:  http://people.csail.mit.edu/kapu/symbian/python.html

Last Updated on Saturday, 07 December 2019 03:01