Accessibility
Felipe Andrade

Felipe Andrade

i2tecnologia.com.br
felipeandrade.org/blog/
flashlite.com.br

Created:
28 May 2007
User Level:
Intermediate
Products:
Devices

Extending Flash Lite 2.1 features with Flyer

This article will take you through XML Sockets connections in Flash Lite 2.1 and show you how to bring the worlds of Flash Lite and Python for S60 together to take photos, send files over a Bluetooth connection, and use or create other very interesting applications that can utilize hardware-level features.

The advantage of Flash Lite over other technologies is that Flash Lite can focus on the presentation of the data, and not necessarily the manipulation of it. The Flash front end can be combined with other languages through the XMLSocket object to provide a highly scalable application.

Requirements

To complete this tutorial you will need the following devices, software, and files:

Flash Professional  (with the appropriate device profile update)

Adobe Flash Lite 2.1

Python for S60 and Python Script Shell

Compatible devices

Any device that supports Flash Lite 2.1 and Python for S60

Sample files: Flyer_1_0_35.zip and FlyerSamples_1_0_35.zip

Prerequisite knowledge

You should be familiar with Flash and Python programming.

Flyer: A Python open source framework

Flyer allows you to easily extend Flash Lite 2.1 features with Python for S60. Flyer is based on Flash Lite 2.1 integration with Python for S60 and contains the following features:

  • Take photos with device cameras from Flash Lite
  • Take device screenshots from Flash Lite
  • Send files over a Bluetooth connection from Flash Lite
  • Get the contact entries in the default device database
  • Convert text to speech
  • Sound recording and playback
  • File download with progress monitor
  • File upload to a remote server
  • Export Microsoft Excel files from Flash Lite

Flash Lite implements a client socket that lets the device running Flash Player establish a communication channel with a Python local server identified by an IP address and a port. The Flyer structure works in modules such as graphics, sound, database, and network that let you easily run the modules as Python standalone applications through Python script shell.

Inside sockets

A socket is the communication mechanism that makes constant a connection among programs. Once a socket connection is established, the client can access a set of services on the server. Sockets can be used as a multiplayer application that lets you interact with others users in real time. A socket example can include real-time data transfer for information such as chats and stock numbers.

Python for S60

Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme, or Java.

Python for S60 Platform simplifies application development and provides a scripting solution for the Symbian C++ APIs. Python for S60 brings the power and productivity of the Python programming language to the S60 platform, and was originally designed to be small, practical, and as open as possible.

Python for S60 platform does not include all of  Python's standard and optional library modules to save storage space in the phone.

Using Flyer

To get Flyer running on your mobile device you have to follow the steps:

  1. Get Flash Lite 2.1 player from Adobe.
  2. Get Python for S60 and Python Script Shell from SourceForge and read more about the PyS60 download and installation on S60 2nd and 3rd edition devices.
  3. Download Flyer_1_0_35.zip and FlyerSamples_1_0_35.zip from Google code.
  4. Run the script on Nokia 3rd editon phones:

    1. Move the Flyer_1_0_35.py script and lib folder from your PC to the 'Python' folder using a USB cable or Nokia PC Suite. (You have to create Python folder on your Memory Card.)
    2. Start the PyS60 interpreter application on your phone. To do this select (snake icon) > press "options" > select "Run script" > select Flyer_1_0_35.py and press OK.
  5. Start your Flyer-based application from Flash Lite 2.1 player.

Samples

There are many samples available to download at google code (see Figure 1), so happy hacking!

Flyer Samples

Figure 1. Different views of the Flyer user interface

Flash Lite as the front end

As I mentioned before, the advantage of Flash Lite over other technologies is that Flash Lite can focus on the presentation of the data, and not necessarily the manipulation of it. The Flash front end can be combined with other languages through the XMLSocket object to provide a highly scalable application.

Where to go from here

Here are some resources to help you learn about and get more involved with Flyer:

http://www.felipeandrade.org/flyer/
http://www.felipeandrade.org/blog/
http://wiki.opensource.nokia.com/projects/Python_for_S60
http://wiki.opensource.nokia.com/projects/Installing_PyS60
http://wiki.forum.nokia.com/index.php/Category:Python#How_To_Guides_for_Python
http://www.adobe.com/devnet/devices/
http://www.python.org/

About the author

Felipe Andrade is CTO and cofounder of i2 tecnologia, a web and interactive company based in Brazil. He is the original creator of Flyer Framework and shares 60% of all donations to Brazilian children. Felipe has expertise in Flash development and has been working with ActionScript for six years. He's an instructor of Flash, ColdFusion, Dreamweaver, and Fireworks; and is experienced with Java and JavaMe. Felipe is the project leader for all games and applications developed by i2 tecnologia, including the award-winning Bone Smashers Arm Wrestling for the Flash Lite platform. He is manager of BRMAD – Adobe Mobile and Devices User Group Brazil and enjoys surfing on weekends.