Pervasive Computing MIT 6.883 SMA 5508 Spring 2006 Larry Rudolph 1 More Python on Series 60 Larry Rudolph SMA 5508 MIT 6.883 (Spring 2006) March 10.

Slides:



Advertisements
Similar presentations
Understanding an Apps Architecture ASFA Computer Science: Principles Fall 2013.
Advertisements

Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
The Web Warrior Guide to Web Design Technologies
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
OS Spring’03 Introduction Operating Systems Spring 2003.
Cosc 4755 Phone programming: GUI Concepts & Threads.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
Operating Systems.
Python for S60 SmartPhones PostPC Workshop Fall 2006 Amnon Dekel.
TIBCO Designer TIBCO BusinessWorks is a scalable, extensible, and easy to use integration platform that allows you to develop, deploy, and run integration.
WORKING WITH MACROS CHAPTER 10 WORKING WITH MACROS.
Operating Systems CSE 411 CPU Management Sept Lecture 11 Instructor: Bhuvan Urgaonkar.
Programming mobile devices Part II Programming Symbian devices with Symbian C++
PROG Mobile Java Application Development PROG Mobile Java Application Development Event Handling Creating Menus.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
4-Sep-15 HTML Forms Mrs. Goins Web Design Class. Parts of a Web Form A Form is an area that can contain Form Control/Elements. Each piece of information.
Copyright 2007, Information Builders. Slide 1 Maintain & JavaScript: Two Great Tools that Work Great Together Mark Derwin and Mark Rawls Information Builders.
Programming Network Servers Topic 6, Chapters 21, 22 Network Programming Kansas State University at Salina.
Lecturer: Ghadah Aldehim
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Copyright 2007, Paradigm Publishing Inc. EXCEL 2007 Chapter 7 BACKNEXTEND 7-1 LINKS TO OBJECTIVES Record & run a macro Record & run a macro Save as a macro-
Operating Systems  A collection of programs that  Coordinates computer usage among users  Manages computer resources  Handle Common Tasks.
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured;
Classes and Objects. Topics The Class Definition Declaring Instance Member Variables Writing Instance Member Methods Creating Objects Sending Messages.
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
Prepared by Fareeha Lecturer DCS IIUI 1 Windows API.
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
PROG Mobile Java Application Development PROG Mobile Java Application Development BlackBerry App Lifecycle Java ME API.
The Fundamentals of Using Windows 95. Windows 95 ã operating system that performs every function necessary for the user to communicate and control computer.
 The World Wide Web is a collection of electronic documents linked together like a spider web.  These documents are stored on computers called servers.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
Device- dependent Runs only on specific type of computer Types of Operating Systems What are some characteristics of operating systems? Next p
Networks and Client/Server Applications Handling Multiple Clients Concurrently.
C# GUI - Basics. Objectives.NET supports two types: WinForms, traditional, desktop GUI apps. WebForms – newer, for Web apps. Visual Studio.NET supports.
1 UNIT 13 The World Wide Web Lecturer: Kholood Baselm.
MIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Lecture 4: Graphic User Interface Graphical User Interface Larry Rudolph MIT 6.893; SMA 5508 Spring 2004.
Symbian Programming Overview Spring 2004: Symbian Larry Rudolph How to program Cellphone? Limited to Series 60 phones Java MidP 2.0 (see wiki,
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
STAGES Language Application Overview. The Language Application is available on a separate URL (typically /stagesLanguage) and tied to only one database.
Threads. Readings r Silberschatz et al : Chapter 4.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
MINIX Presented by: Clinton Morse, Joseph Paetz, Theresa Sullivan, and Angela Volk.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Systems and User Interface Software. Types of Operating System  Single User  Multi User  Multi-tasking  Batch Processing  Interactive  Real Time.
Munis Version 9.1 & 8.3 Sneak Peek System Administration.
1 UNIT 13 The World Wide Web. Introduction 2 Agenda The World Wide Web Search Engines Video Streaming 3.
1 UNIT 13 The World Wide Web. Introduction 2 The World Wide Web: ▫ Commonly referred to as WWW or the Web. ▫ Is a service on the Internet. It consists.
CHAPTER 6 Threads, Handlers, and Programmatic Movement.
Big Picture Lab 4 Operating Systems C Andras Moritz
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Python for Series 60 Platform CTPUG Graeme Glass.
Networks and Client/Server Applications
Python …III N Amanquah Based on EPROM curriculum.
Python …II N Amanquah Based on EPROM curriculum.
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
Processor Management Damian Gordon.
Topics Introduction to File Input and Output
Lecture Topics: 11/1 General Operating System Concepts Processes
Chapter 3: Processes.
CSE 153 Design of Operating Systems Winter 2019
Topics Introduction to File Input and Output
Processor Management Damian Gordon.
Presentation transcript:

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph 1 More Python on Series 60 Larry Rudolph SMA 5508 MIT (Spring 2006) March 10

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph Where to get information there are a few more documents (like getting started; building an app; C++ extensions) to be gotten from the 1.2 python release Around the web, but bunch of older versions around -- be careful our wiki, look at IAP 2006

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph Today’s Topics Examples Screen Network Active Objects Bluetooth Callgate

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph Processes, Threads, Active Objects Process: address space + threads A main thread interacts with user interface. Can directly call UI. If blocks, application blocks Heap (shared by all threads) No statics (in DLL), but yes in new: S60-FP3 Thread: Program Counter + AO + stack (small) AO (Active Object): Pieces of thread code that interacts with User Interface

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph Processes Each application and each service (I think) execute as separate processes Each process has its own address space We will not deal with interprocess communication (but could use sockets) An application is a process that may have UI and Engine parts Access System and Server APIs

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph DLL’s and API’s API: the exported published behaviour a system component exposes to other components Symbian OS DLL components can: define an API for use by other components (system libs, app. engines) implement an API defined by a framework GUI applications, device drivers these are plug-in’s into a framework

Apps, DLL, API

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph Processes (exe, app) an application has only one user interface thread sockets & file objects cannot be shared among threads why?

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph Process & Threads only one thread in process has access to UI sockets & file objects cannot be shared among threads why?

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph What kind of OS? Multi-tasking Multi-threading Real-time

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph UI Thread places objects on screen registers callbacks procedures associated with screen & keyboard events when event occurs, want to pass control to the callback procedure. what if thread is executing something else? Callbacks should execute quickly UI thread should spend most of the time idle

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph Coordination Don’t use normal thread locks: import thread lock = thread.allocate_lock() Whole application gets blocked, since no UI actions would be handled Use e32.Ao_lock instead

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph Active Objects If Symbian written today, AO’s would be called “listeners” Get called by scheduler (have a little bit of state) Run to completion then return to scheduler

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph Python’s AO Previous discussion was for Symbian in general Python hides the scheduler but after setting up callbacks, just do a return Can control AO by allocating an e32.Ao_lock() and then doing wait() and signal() with this lock

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph Python User Interface This diagram shows the pieces Ignore it

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph User Interface Approach What should we care about? Graphical User Interface (GUI) is big deal Small screen ==> make best of poor situation Will screens get bigger? Will Nokia’s UI approach scale? What about other input modalities? Alternatives: PocketPC, Palm, Blackberry Gameboy, Playstation, Smart Watches

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph Nokia’s Approach Nokia’s UI philosophy (are they unique?) Uniform across apps; branded look&feel Screen title at top Optional tabs just below that Body (and for pop-ups) Bottom softkeys: Menu (left), Exit (right)

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph SPy60 Approach provide option for more usable screen area great for prototyping. Use default font & size; minor graphics

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph Using the screen Appuifw contains an instance of the class application, called app appuifw.app.title = u’title of screen’ appuifw.app.screen = ‘normal’ # size *.app.body = Text | Listbox | Canvas *.app.menu = list of (title, callback) *.app.set_tabs( list of tab names, callback)

Pervasive Computing MIT SMA 5508 Spring 2006 Larry Rudolph SMS messaging Can send SMS: sms_send(nmbr, mess) limit of 160 characters Can access phone’s inbox plop it into a list, access fields of mess Register callback for whenever mess arrives Need to be connect to phone network and need to be running when msg arrives

import e32import appuifwfrom MyDataAccess import MyDataAccesse32.ao_yield()def format(item): # Format the item as a short unicode string. return u"" # omittedclass MyApp: def __init__(self): self.lock = e32.Ao_lock() self.old_title = appuifw.app.title appuifw.app.title = u"My Application" self.exit_flag = False appuifw.app.exit_key_handler = self.abort self.data = [] appuifw.app.body = appuifw.Listbox([u"Loading..."], self.handle_modify) self.menu_add = (u"Add", self.handle_add) self.menu_del = (u"Delete", self.handle_delete) appuifw.app.menu = [] # First call to refresh() will fill in the menu.

Def connect(self, host): self.db = MyDataAccess(host) self.db.listen(self.notify) # Set up callback for change notifications. def loop(self): try: self.lock.wait() while not self.exit_flag: self.refresh() self.lock.wait() finally: self.db.close() def close(self): appuifw.app.menu = [] appuifw.app.body = None appuifw.app.exit_key_handler = None appuifw.app.title = self.old_title def abort(self): # Exit-key handler. self.exit_flag = True self.lock.signal() def notify(self, in_sync): # Handler for database change notifications. if in_sync: self.lock.signal() def refresh(self): # Note selected item. current_item = self.get_current_item() # Get updated data. self.data = self.db.get_data() if not self.data: content = [u"(Empty)"] else: content = [format(item) for item in self.data] if current_item in self.data: # Update the displayed data, # retaining the previous selection. index = self.data.index(current_item) appuifw.app.body.set_list(content, index) else: # Previously selected item is no longer present, so allow # the selection to be reset. appuifw.app.body.set_list(content) if not self.data: appuifw.app.menu = [self.menu_add] else: appuifw.app.menu = [self.menu_add, self.menu_del]

def handle_modify(self): item = self.get_current_item() if item is not None: # Display data in Form for user to edit. # Save modified record in database. pass # omitted def handle_add(self): new_item = self.edit_item(ToDoItem()) if new_item is not None: # User enters new data into Form. # Save new record in database. pass # omitted def handle_delete(self): item = self.get_current_item() if item is not None: # Remove record from database. pass # omitted def get_current_item(self): # Return currently selected item, or None if the list is empty. if not self.data: return None else: current = appuifw.app.body.current() return self.data[current] def main(): app = MyApp() try: hosts = [u"some.foo.com", u"other.foo.com"] i = appuifw.popup_menu(hosts, u"Select server:") if i is not None: app.connect(hosts[i]) app.loop() finally: app.close()if __name__ == "__main__": main()