I was one of the lucky ones who lost their cellphones a few months ago, during that crazy AC/DC concert. Surprisingly, that didn’t upset me at all; although I’m not a heavy user, that was the perfect opportunity for me to get my first smartphone.
I ended up with a Nokia 5800 XpressMusic, a relatively cheap smartphone with a nice feature set. Specifically, what took me for granted was the ability to run Python applications in it!
But what exactly can we do with Python for S60? Well, to answer that question, I decided to implement a non-trivial app to see exactly what it has to offer. The app in question is a Bluetooth remote control called Pytriloquist. (see also screenshots and a video demonstration.)
What’s Good
Platform Independence. The S60 SDK is for Windows only (what a surprise). This is obviously bad for those who use other operating systems. Fortunately, you don’t need a massive SDK to develop and deploy S60 apps if you write them in Python; all you need is Python for S60, a text editor, and a device for testing.
Language and Standard Library. Python is a terrific language: compact, beautiful, powerful, and have an amazing standard library. The good news is that the most popular modules work great on S60. For example, it’s even possible to localize your apps using the gettext module!
What’s Bad
Work in Progress. Python for S60, as long as I know, is a work in progress. This means the language itself works fine, but you can expect missing modules or some bugs in standard library. For example, when writing the Bluetooth client code for my app, I encountered a very annoying bug in which you can only call btsocket.bt_discover() once!
Multi-Module Code. If you are testing your app with Python ScriptShell, everything will work out-of-the-box as long as keep your whole code inside a single massive module. If you break up your code into several modules (or worse, packages) you won’t be able to have modules importing each other unless you adjust the PYTHON_PATH accordingly.
Incomplete and Outdated Documentation. There are some PDFs and API documentation pages available, but they are incomplete and outdated, and this is a bad thing when it comes to dynamic languages; we don’t have a compiler to tell us what’s wrong with our code. This is why Python programmers are so careful about documentation in the first place.
What’s Ugly
Limited Access to Native Features. Specially regarding the native UI system: you cannot change the label of the two standard soft keys, nor add other soft keys, nor add more than two tabs in a tabbed UI, nor have an empty Listbox, nor lots of other things. You can write simple UIs without much effort, that’s true, but those shortcomings just make Python for S60 unusable for more complex projects.
Project Inactivity. The project appears to be on hold. New bug reports are submitted every now and then, but no bugs are closed for six months.
Conclusion
Let’s hope things change for the better after the last announcement made by the Symbian Foundation, but in the meantime, if you pretend to create serious apps for S60, do it in C++.
Posts em Português
Posts in English