Mobile Python: Rapid Prototyping of Applications on the Mobile Platform
Back to front page

Table of Contents

Contributors ix
About the Authors xi
Authors' Acknowledgments xiii
Symbian Press Acknowledgments xvii
Foreword xix
Foreword xxi
Glossary xxiii
Examples xxvii
Python Language Lessons xxxiii
Python for S60 Modules xxxv

1 Introduction and Basics 1
1.1 Why Does Python Make a Difference? 3
1.2 How to Use this Book 4
1.3 Who Is this Book For? 5
1.4 What Are Symbian OS, S60 and Python for S60? 6
1.5 Python Terminology in this Book 7
1.6 Democratizing Innovation on the Mobile Platform 8
1.7 The Process of Rapid Prototyping with Python S60 10
1.8 Summary 11

2 Getting Started 13
2.1 Installing Python for S60 on 3rd Edition Devices 14
2.2 Installing Python for S60 on 2nd Edition Devices 21
2.3 Writing a Program in Python for S60 27
2.4 White Space in Python Code 28
2.5 Troubleshooting 29
2.6 Summary 30
3 Graphical User Interface Basics 31
3.1 Using Modules 31
3.2 Native UI Elements - Dialogs, Menus and Selection Lists 32
3.3 Messages 45
3.4 Summary 47

4 Application Building and SMS Inbox 49
4.1 Functions 49
4.2 Application Structure 52
4.3 String Handling 60
4.4 SMS Inbox 64
4.5 SMS Game Server 70
4.6 Summary 76
5 Sound, Interactive Graphics and Camera 77
5.1 Sound 77
5.2 Keyboard Keys 84
5.3 Graphics 92
5.4 Camera 100
5.5 Mobile Game: UFO Zapper 104
5.6 Summary 110

6 Data Handling 111
6.1 File Basics 112
6.2 Reading and Writing Text 117
6.3 Local Database 121
6.4 GSM and GPS Positioning 123
6.5 Vocabulector: A Language Learning Tool 127
6.6 Summary 131

7 Bluetooth and Telephone Functionality 133
7.1 Bluetooth Pairing 134
7.2 OBEX and RFCOMM 134
7.3 Phone to Phone Communication 136
7.4 Phone to PC Communication 141
7.5 Communication with GPS and Other Devices 148
7.6 Telephone Functionality and Contacts 151
7.7 System Information 152
7.8 Summary 154

8 Mobile Networking 155
8.1 Simple Web tasks 156
8.2 Setting up the Development Environment 158
8.3 Communication Protocols 166
8.4 Server Software 172
8.5 Pushing Data to a Phone 177
8.6 Peer-to-Peer Networking 183
8.7 Using a Phone as a Web Service 193
8.8 Summary 197

9 Web Services 199
9.1 Basic Principles 200
9.2 MopyMaps! Mobile Yahoo! Maps 201
9.3 EventFu: Finding Eventful Events 207
9.4 InstaFlickr: Shoot and Upload Photos to Flickr 215
9.5 Summary 224

10 Effective Python for S60 227
10.1 Powerful Language Constructs 227
10.2 Introspection 231
10.3 Custom Modules and Automatic Updating 234
10.4 Program Patterns 239
10.5 Summary 241

11 Combining Art and Engineering 245
11.1 MobiLenin 245
11.2 Manhattan Story Mashup 252
11.3 MobileArtBlog - Image Composition Tool 256
11.4 ArduinoBT Micro-Controller Board 261
11.5 Controlling Max/MSP with a Phone 266
11.6 OpenSound Control 273
11.7 Robotics 274
11.8 Summary 277

Appendix 1: Platform Security 279
Appendix 2: Bluetooth Console 289
Appendix 3: Debugging 295
Appendix 4: How to Use the Emulator 301
References 303
Index 305