Python Framework for Symbian Series 60 phones

Wednesday 27 September 2006

Journal

Today has been quite productive. I've searched in the poor documentation of the XML module we are using on the phone the methods we need for parsing a complete file. The result is quite satisfying. The XML module takes a little while to be loaded but after result is very fast.

So, we have a new method MParser inheriting from ElementTree added to MobiliiPuntariAPI.xml package able to:

  • parse from url (fromurl())
  • parse from file (fromfile())
  • parse from string (fromstring())
  • convert a tree object to a string (tostring())

Maybe an error handler could be added later if new issues are found. Tomorrow, I'll add the possibility to pass a callback method to extract and return only the information needed to a dictionary format.

Tuesday 26 September 2006

Journal

Dear journal :)

After fighting 3 days with the XML libraries I found a solution. It uses cElementtree like previously mentioned. SIS package is available for versions up to S60 2nd edition. Read this thread for more info http://discussion.forum.nokia.com/forum/showthread.php?t=90292.
Download SIS package is here. Or what I advice is to download the project package because it includes sources and different libraries used on the emulator.

To install cElementTree on the emulator (S60 2nd edition):

  • unzip cElementTree-pys60-v1.0.5.zip
  • copy binaries\wins\udeb\CELEMENTTREE.PYD to C:\Symbian\8.0a\S60_2nd_FP2\epoc32\release\wins\udeb\z\system\Libs
  • copy "elementtree" folder to to C:\Symbian\8.0a\S60_2nd_FP2\epoc32\release\wins\udeb\z\system\Libs
  • then test the installation with a little script like:
import cElementTree as et
e=et.fromstring("<hello>world</hello>")
print e.tag, e.text
  • you should get:
...
Version 1.3.1 final
hello world

There is an *untested* alpha release for S60 3rd edition:

Monday 25 September 2006

Journal

I'm having a really bad suprise: NOKIA team kind of forgot to include XML utilities in PyS60 :'( So I've been through painfull researches and I found the following solutions:

  • it is possible to install xmlproc. Advantage: pure python integration so 100% protable. Problem: because it is a pure python integration it will requires a lot of memory and will be very slow. I'm even scared to exceed the memory and freeze the phone. Second problem: I have difficulties to install it on the interpreter, there is no installtion package for the phone. So it makes difficult to port on the phone until I don't find a way to make it work if no other appropriate solution is found.
  • second solution is to install pyexat that use a well known Expat C library (home page). Advantages: works like a dream until S60 2nd edition. Problem: no distribution for emulator which means debuggin everything on the phone and not compatible S60 3rd edition.
  • one track: one guy from NOKIA Forum has ported http://effbot.org/zone/celementtree.htm to 3rd edition and try to release it soon. Questions: is there any built version for phone and emulator up to S60 2nd edition? I'm waiting for an answer but it seams that it would be the best solution to my eyes...

So i'm searching for a solution which could be portable to S60 1st, 2nd and 3rd edition but is it even possible???

Wednesday 20 September 2006

Journal

I've been through difficulties to configure the sdk in order to have one compatible for Carbide and VS at the same time.
To list the divices and show the default one, in a command prompt type:

C:\>devices

To change the default device, in a command prompt type:

C:\>devices -setdefault @S60_2nd_FP2:com.nokia.Series60

Today we almost finished porting the SHA256 module for the phone. It consists in creating a polymorphic dll which as a .pyd extention. I'll put the source available as soon as it's finished.

Monday 18 September 2006

Journal

Following the last meeting, I did some modifications to the documentation. It has now a tree view to make the navigation and a search engine. A compiled HTML version of the doc is also available now.

Last Friday I started with Jouni to look at the SHA-256 C source to port it to the phone. I had the wrong SDK installed on the desktop machine and Visual Studio was missing. So I installed the proper SDK, Visual Studio, Carbide .vs. I will be now able to compile a project.

I need now to finish declaring the Symbian project properly and try to compile it for the phone.

Meeting report (2006-09-15):

This meeting as highlighted the current state of the thesis work. According to the advices given, the following modifications were made:

  • The HTML documentation uses now frames and tree navigation. Documentation has been updated and shared. A complied HTML doc is also available for download
  • The project schedule is updated with the current state

Nothing else for now.

Thursday 14 September 2006

Documentation

MobiiliPuntariAPI:


lfdm:

  • version 0.2 - 05 January 2007 (Open source: ONLY UI shared to the public - compiled help in the download section)

Wednesday 13 September 2006

Meeting report (2006-08-21):

Several question and unclear point were left at the end of our last meeting.

  • We treated about differences and compatibility issues between Symbian version and API. You can find below a list of susceptible compatible NOKIA phones for our framework

    S60 2nd Ed phone supposed to be compatible with the python framework:

    Model Feature Pack O.S
    N70 fp3 8.1a
    N72 fp3 8.1a
    N90 fp3 8.1a
    6630 fp2 8.0a
    6680 fp2 8.0a
    6681 fp2 8.0a
    6682 fp2 8.0a
    3230 fp1 7.0s
    6260 fp1 7.0s
    6600 fp1 7.0s
    6620 fp1 7.0s
    6670 fp1 7.0s
    7610 fp1 7.0s

    Depending on the new API pdf, the new version of the Python interpreter (1.3.1) seems to have fixed Symbian 1st edition camera module compatibility, but it needs to be verified. If verified, the following phones would be added to the list of compatible NOKIA phone:

    S60 1st Ed phone supposed to be compatible with the python framework:

    Model Feature Pack O.S
    3600 nc 6.1
    3620 nc 6.1
    3650 nc 6.1
    3660 nc 6.1
    7650 nc 6.1

    3rd edition phones are excluded for now until we don’t get enough information about compatibility issues due to the new security level on the phone. Also the python interpreter for 3rd editions (1.3.8) is only a BETA releases. A stable release is expected for the autumn with updated documentation.


  • UML for Python:

    After long research on the net, it comes to the conclusion that it is not yet possible to generate Python code skeleton from UML charts. The only interesting software found is Gaphor (http://gaphor.sourceforge.net) which has a code reverse engineer plug-in for Python code. This software has been developed for GNOME, at first, but is now ported to windows. I’m testing it now.


  • UML for the thesis work:

    Since we don’t have any tools for generating skeleton, the UML in the analyze part will be only about drawing UML chart.


  • Carbide & Python:

    So far, there is no way to create Symbian projects under Carbide for PyS60. Nether, there is no success for packaging PyS60 application. I keep those results under reserve. Carbide C++ being on top of Eclipse, any twisting with the SDK is possible and anybody could publish a plugin or extension on that way.

Thesis description:

A software framework is a reusable design for a software system (or subsystem). This is expressed as a set of abstract classes and the way their instances collaborate for a specific type of software (Johnson and Foote 1988; Deutsch 1989). All software frameworks are object-oriented designs. Although designs don't have to be implemented in an object-oriented language, they usually are.

According to Pree (1994), software frameworks consist of frozen spots and hot spots. On the one hand, frozen spots define the overall architecture of a software system, that is to say its basic components and the relationships between them. These remain unchanged (frozen) in any instantiation of the application framework. On the other hand, hot spots represent those parts where the programmers using the framework add their own code to add the functionality specific to their own project.

Software frameworks define the places in the architecture where adaptations for specific functionality should be made - the hot spots. In an object-oriented environment, a framework consists of abstract and concrete classes. Instantiation of such a framework consists of composing and subclassing the existing classes (Buschmann 1996).

When developing a concrete software system with a software framework, the hot spots are specialized according to the specific needs and requirements of the system. Software frameworks rely on the Hollywood Principle: "Don’t call us, we’ll call you." (Larman 2002). This means that the user-defined classes (for example, new subclasses), receive messages from the predefined framework classes. These are usually handled by implementing superclass abstract methods.

The challenge for this final thesis is to implement those notions of software framework in an embedded system such as a phone running on Symbian OS series 60. The choice of Python scripting language is the main concern for this framework. In order to meet the final thesis attempt, the framework will be evaluated and compared to similar Java client implementation. This will define the operability and interest on commercial projects.

The work will be divided in five parts: learning part, system analyse, coding, testing and then documenting. The learning part will treat the phone architecture, the analysing tools and method, the testing tools and methods. The analysing part consists in drawing a UML2 representation of the framework and defining the structure, hot and cold spots, agents and relationships. Then, the coding part concentrate in coding the UML2 analyse in Python scripting language. The testing part will insure that the software meets the specifications. Finally, the documentation will be made since the beginning of the thesis period.

Tuesday 12 September 2006

Thesis Estimated Schedule

schedule.png
g.png  Click to enlarge
download.png Project file


Current State (2006-09-16)


Project Start Date: Tue 13/06/06
Project Finish Date: Fri 08/12/06

Name
Duration Start_Date Finish_Date Percent_Complete
Learning
127 days Thu 15/06/06 Fri 08/12/06 60%
Being active Nokia Forum Community
127 days Thu 15/06/06 Fri 08/12/06 53%
Python & S60 skills
77 days Thu 15/06/06 Fri 29/09/06 100%
UML2 & tools
77 days Thu 15/06/06 Fri 29/09/06 0%
XML & Python
77 days Thu 15/06/06 Fri 29/09/06 50%
MobiiliPuntari Investigation
77 days Thu 15/06/06 Fri 29/09/06 100%
Analyse
40 days? Mon 28/08/06 Fri 20/10/06 41%
Client Server Communication
5 days? Mon 28/08/06 Fri 01/09/06 70%
XML Parser
5 days? Mon 04/09/06 Fri 08/09/06 0%
Transfert module
5 days? Mon 11/09/06 Fri 15/09/06 30%
User setting & Authentication
5 days? Mon 18/09/06 Fri 22/09/06 20%
Camera module
5 days? Mon 25/09/06 Fri 29/09/06 100%
GUI module
5 days? Mon 02/10/06 Fri 06/10/06 50%
Framework Core Design
10 days Mon 09/10/06 Fri 20/10/06 30%
Coding
62 days? Mon 28/08/06 Tue 21/11/06 30%
End User Testing
10 days Wed 08/11/06 Tue 21/11/06 0%
Documenting
118 days? Thu 15/06/06 Mon 27/11/06 44%
Engineer Journal
118 days? Thu 15/06/06 Mon 27/11/06 57%
Thesis report
41 days? Mon 02/10/06 Mon 27/11/06 0%
meeting1 report - week
7 days? Thu 15/06/06 Fri 23/06/06 100%
meeting2 report - week34
5 days? Mon 21/08/06 Fri 25/08/06 100%
meeting3 report - week37
5 days? Mon 11/09/06 Fri 15/09/06 100%
meeting4 report - week40
5 days? Mon 02/10/06 Fri 06/10/06 0%
meeting5 report - week43
5 days? Mon 23/10/06 Fri 27/10/06 0%
meeting6 report - week46
5 days? Mon 13/11/06 Fri 17/11/06 0%
meeting7 report - week49
1 day Mon 27/11/06 Mon 27/11/06 0%
Meetings
122 days? Thu 15/06/06 Fri 01/12/06 44%
meeting1 - week
7 days? Thu 15/06/06 Fri 23/06/06 100%
meeting2 - week34
5 days? Mon 21/08/06 Fri 25/08/06 100%
meeting3 - week37
5 days? Mon 11/09/06 Fri 15/09/06 100%
meeting4 - week40
5 days? Mon 02/10/06 Fri 06/10/06 0%
meeting5 - week43
5 days? Mon 23/10/06 Fri 27/10/06 0%
meeting6 - week46
5 days? Mon 13/11/06 Fri 17/11/06 0%
meeting7 - week49
1 day Mon 27/11/06 Mon 27/11/06 0%
Milestones
21 days Fri 03/11/06 Fri 01/12/06 0%
Language checking
1 day Fri 03/11/06 Fri 03/11/06 0%
Seminars
3 days Wed 22/11/06 Fri 24/11/06 0%
Theses for supervisors
1 day Wed 29/11/06 Wed 29/11/06 0%
Evaluation meeting
1 day Fri 01/12/06 Fri 01/12/06 0%

Journal

Today I have installed and configured quickly a website to keep my engineering journal and the members of the team informed of the thesis work state. Also source code and documentation are available for members of the team.

LEFEVRE Damien
http://www.lfdm.net
contact@lfdm.net