HomePython Mobile Programming in Python using PyS60: Getting Started
Mobile Programming in Python using PyS60: Getting Started
Smart phones are becoming a common sight nowadays. Above all, the "smartness" of smart phones come from the fact that they can be programmed. In other words, one can develop custom applications for these mobile devices and use them in the devices. This article covers the basics of developing these kinds of applications in a variant of Python.
Almost all languages, from C to Java and Perl to Ruby, provide APIs to access and create servicesfor smart phones. Among them, nothing, at present, can beat the flexibility and ease-of-development that Python provides. Symbian is the most common OS used by smart phones. The Symbian port of Python is known as pyS60.
in this discussion I will be focusing on the basics of pyS60. The first two sections will focus on answering the question "what is pyS60?" In the third section, I will detail the steps in developing and deploying a pyS60 application. In the last section, a real world application will be developed. That sets the outline for this discussion.
What is PyS60?
PyS60, also known as Python for S60 version, is a port of Python, released by Nokia for Symbian OS and targeted at the N60 series of mobiles. The libraries provided by PyS60 can be divided into broad categories:
1. Built-in libraries
2. Dynamically loadable libraries
Since PyS60 is essentially an extension to the standard Python, it is known as the Python for S60 extension. Hence the categories can also be called built-in extensions and dynamically loadable extensions. Here are the details.
Built-in libraries or extensions are one of the two native C++ extensions available in PyS60. These provide non-proprietary APIs to Symbian 60’s (S60) platform. The built-in extensions again are divided into two modules, e32 and appuifw.
The e32 module provides access to those services that are not available in standard Python libraries. Essentially, this module is built into the Python interpreter to provide access to the Platform services of S60. These services include the timer service (Ao_timer class), system information (sysinfo module and its classes), listing of the drives (drive_list method) and more.
By using the appuifw module, the developer can access the API related to the UI elements of the S60 platform. The main UI elements include Text, Listbox, Canvas, and so forth. Using the elements a GUI can be constructed either as part of a window or as the part of screen itself. If the elements or controls are part of the window then the window becomes the container.