Python for S60 SmartPhones PostPC Workshop Fall 2006 Amnon Dekel
S60? What? 2 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
What is Python Python is an Open Source programming language developed by Guido van Rossum Python Python is an interpreted, interactive, object- oriented programming language. It is often compared to Tcl, Perl, Scheme or Java. The popularity of Python is on the rise. Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing. From: Python Tutorial: Jurgen Scheible (c) Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Who Uses Python? Google NASA Industrial Light and Magic Many more 4 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Python for S60 Python for Series 60 brings the Python programming language to the Series 60 Platform, Nokia's "modified/enhanced" version of the Symbian Operating System platform for Mobile devices. Python for Series 60 Currently Python for Series 60 is based on Python It Supports many of the Python Standard Library modules but has on top a few mobile platform specific modules e.g. - native GUI widgets, - Bluetooth - GPRS networking - GSM Location information, - SMS Messaging, - Acces to camera and more! 5 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006 From: Python Tutorial: Jurgen Scheible (c) 2006
Python for S60 - Capabilities GUI: Menu, Forms, Listboxes, Input fields, Dialogs, Notes Graphics: - color, font and style attributes, - direct- screen drawing, - displaying images and icons Key- down and key-up events Sockets: TCP/IP, Bluetooth (RFCOMM, OBEX) Messaging (SMS) Networking (HTTP, FTP, …) Access to file system, file reading, XML, RSS Access to camera, telephone Access to calendar, contacts, sysinfo Location (cell-id) Content handler Python extensions can be written in C++ Make standalone applications 6 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006 From: Python Tutorial: Jurgen Scheible (c) 2006
Python for S60 - Installing 1. Determine the Phone Version: S60 1 st Edition, 2 nd Edition, 2 nd Edition FP2, 2 nd Edition FP3, 3 rd Edition Search for your phone model here: Our Phones: 6680: Series 60 2nd Edition, Feature Pack 2 (Version 2.6), based on Symbian OS version 8.0a N80: S60 3rd Edition (Version 3.0), based on Symbian OS version Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Python for S60 - Installing 1. Download and Install Python S60: Find the installer for the phone Install first the PythonForS60 package and then the PythonScriptShell package. More Installation Info 8 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Other Files and Documents File Manager: FExplorer for Series 60 FExplorer for Series 60 SExplorer for Series 60 3 rd Edition SExplorer for Series 60 3 rd Edition Documentation: PythonForS60_doc_1_3_1.pdf It is a helpful documentation on Python for Series 60 API's. PythonForS60_doc_1_3_1.pdf Python Library Refernence (2.2.3) It is useful for checking out standard Python stuff. Python Library Refernence (2.2.3) Other documents: Programming_with_Python.pdf Programming_with_Python.pdf Getting_Started_with_Python.pdf Getting_Started_with_Python.pdf 9 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006 From: Python Tutorial: Jurgen Scheible (c) 2006
Links The Tutorial: Code Snippets: Python.org: Download Python + IDE’s for your workstation Python for S60 Discussion Board: =102 (this is where to find the latest releases and updates) =102 Python for S60 WIKI: Python for S60 Emulator:Emulator 10 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Hello World OK- we have installed Python S60 on our Phones – Now lets get to Hello World 11 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Hello World 1. Write your script in a text editor on your workstation 2. Save it as filenaeme.py 3. Transfer it to your phone and run it 12 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Hello World Write your script in a text editor on your workstation 13 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006 From: Python Tutorial: Jurgen Scheible (c) 2006
Hello World Save it as filenaeme.py 14 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Hello World Transfer it to your phone: Install Nokia PC Sync Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Hello World Transfer it to your phone: Install Nokia PC Sync Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Hello World Transfer it to your phone 17 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Hello World 6680: Open FExplorer on the phone Navigate to the Directory where you saved the file 18 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Hello World N80: Open SExplorer on the phone Select the 3 rd Shortcut on the Standby Menu 19 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Hello World Run Python on the Phone 20 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006
Lets Try Write the Hello world code Save to disk Transfer to Phone Install: 6680: Install as Python Script N80: Copy and Paste into C:\Python\ Run in Python for S60 Python for S60 Workshop -- Amnon Dekel – HUJI Nov
Homework Go through the Python for S60 TutorialTutorial Do the exercises in the tutorial Write an app that uses the following: Reads User input Outputs user input to screen Menu Record Audio, Play back Audio Snap Photo, Show Photo, Upload* photo to web page If you have a 3G SIM* (insert and use in the phone) Send an SMS to user supplied number with URL to The web page with the photo (so they can see it on their phone – make sure the image is not too large) Python for S60 Workshop -- Amnon Dekel – HUJI Nov
Phone Usage We have 2 Phones for your use They will be available for use in the Lab (Ross 19) (They must NOT be taken out) They must be signed out with your student or ID card There is the option of using an Emulator* *: I have not done this – you are on your own Python for S60 Workshop -- Amnon Dekel – HUJI Nov Installing_PyS60#Emulator_installation
Contacting Me cs 24 Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006