24
Python for S60 Python for S60 SmartPhones SmartPhones PostPC Workshop Fall 2006 Amnon Dekel

Python for S60 SmartPhones PostPC Workshop Fall 2006 Amnon Dekel

Embed Size (px)

Citation preview

Python for S60 Python for S60 SmartPhonesSmartPhones

PostPC WorkshopFall 2006

Amnon Dekel

S60? What?S60? What?

2Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

What is PythonWhat is Python Python is an Open Source programming

language developed by Guido van Rossum 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) 20063

Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Who Uses Python?Who Uses Python? Google NASA Industrial Light and Magic Many more

www.python.org

4Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Python for S60Python 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.

Currently Python for Series 60 is based on Python 2.2.2.

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!

5Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

From: Python Tutorial: Jurgen Scheible (c) 2006

Python for S60 - Python for S60 - CapabilitiesCapabilities

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

6Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

From: Python Tutorial: Jurgen Scheible (c) 2006

Python for S60 - InstallingPython for S60 - Installing1. Determine the Phone Version:

• S60 1st Edition, 2nd Edition , 2nd Edition FP2, 2nd Edition FP3, 3rd Edition

• Search for your phone model here: http://en.wikipedia.org/wiki/Nokia_S60_and_Symbian_OS

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 9.1

7Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Python for S60 - InstallingPython for S60 - Installing1. Download and Install Python S60:

http://sourceforge.net/project/showfiles.php?group_id=154155 Find the installer for the phone• Install first the PythonForS60 package

and then the PythonScriptShell package.

More Installation Info

8Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Other Files and DocumentsOther Files and Documents File Manager:

FExplorer for Series 60 SExplorer for Series 60 3rd Edition

Documentation: PythonForS60_doc_1_3_1.pdf It is a helpful

documentation on Python for Series 60 API's. Python Library Refernence (2.2.3) It is useful for

checking out standard Python stuff. Other documents:

Programming_with_Python.pdf Getting_Started_with_Python.pdf

9Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

From: Python Tutorial: Jurgen Scheible (c) 2006

LinksLinks The Tutorial:

http://www.mobilenin.com/pys60/menu.htm Code Snippets:

http://www.bigbold.com/snippets/tag/series60 Python.org:

• Download Python + IDE’s for your workstation Python for S60 Discussion Board: http://

discussion.forum.nokia.com/forum/forumdisplay.php?f=102 (this is where to find the latest releases and updates)

Python for S60 WIKI: http://wiki.opensource.nokia.com/projects/Python_for_S60

Python for S60 Emulator:

10Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Hello WorldHello World OK- we have installed Python S60

on our Phones – Now lets get to Hello World

11Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Hello WorldHello World1. Write your script in a text editor on

your workstation2. Save it as filenaeme.py3. Transfer it to your phone and run it

12Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Hello WorldHello World Write your script in a text editor on

your workstation

13Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

From: Python Tutorial: Jurgen Scheible (c) 2006

Hello WorldHello World Save it as

filenaeme.py

14Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Hello WorldHello World Transfer it to your phone: Install Nokia PC Sync

http://europe.nokia.com/A4144903

15Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Hello WorldHello World Transfer it to your phone: Install Nokia PC Sync

http://europe.nokia.com/A4144903

16Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Hello WorldHello World Transfer it to

your phone

17Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Hello WorldHello World 6680: Open FExplorer on the

phone• Navigate to the Directory where you saved the file

18Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Hello WorldHello World N80: Open SExplorer on the phone

• Select the 3rd Shortcut on the Standby Menu

19Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Hello WorldHello World Run Python on the Phone

20Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006

Lets TryLets 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 200621

HomeworkHomework Go through the Python for S60 Tutorial

• 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 200622

Phone UsagePhone 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 200623

http://wiki.opensource.nokia.com/projects/Installing_PyS60#Emulator_installation

Contacting MeContacting Me amnoid @ cs

24Python for S60 Workshop -- Amnon Dekel – HUJI Nov 2006