Porting Flashlite Player on Symbian Series 60 Devices based on Symbian OS V7.0
Introduction
Symbian is an Operating System for smart phones and is licensed by mobile phone manufactures like Nokia, Sony etc. It's the market leader and accounts for more than 50% of market share. For mobile application development Symbian OS provides four major SDKs namely S60, S80, UIQ and S90, of which S60 and UIQ SDKs are widely used. S90 SDK is amalgamated with S60 SDK.

Symbian OS is a feature-rich operating system that supports graphics and audio, multimedia applications. The communication protocol can be serial communication via Bluetooth/infrared, and network communication using the TCP/IP protocol (IPv6 is supported). Telephony and messaging are also available with support for Multimedia Messaging Service (MMS).
About Symbian OS
In general, the Symbian OS components are classified in such a way that they ensure maximum interportability between all products containing Symbian OS. The below classification is a simplified version of the system definition.
Common Symbian
Common Symbian components should be present in every phone for building of the Core part of Symbian and to export a public API that is maintained across all phones based upon the same Symbian OS version. The code written for the published API should compile and run without errors on all such phones. The core API and behavior must be maintained and the implementation not changed excessively.
Common Replaceable
Common replaceable components are low-level hardware-specific components supplied together with the common Symbian components which are needed to make a working system ROM. The versions of these low-level components supplied as part of Symbian OS are targeted at the reference hardware and are expected to be replaced.
Optional Symbian
Optional Symbian components are optional for all phones, though they are never omitted in practice . However, if an optional Symbian component is present a developer can expect its public API to be maintained.
Optional replaceable
Optional replaceable components in Symbian OS phones are optional. There is no requirement for these public API to be maintained across phones based upon the same Symbian OS version. Developers can (and do) introduce their own APIs, although these will often be standardized across a platform.
Symbian OS supports interportability, hence a wide range of mobile phones have been utilizing these features and providing a higher level of comfort usage to the end user.
There are different versions of Symbian OS available in the market and for this development the Symbian OS V7.0 and also the Series 60 SDK 2nd edition is based on Symbian OS V7.0.
About Flashlite 2.0 Player
Adobe Flashlite 2.0 Player is an application which is used to view SWF (Shock Wave Flash) files. Flashlite Player is an application specifically designed to view SWF files on mobile phones. Flashlite Player is a trimmed down version of Adobe Flash Player.
Flashlite Player can be ported to a wide range of mobile phones available in the market. SWF files can also contain animated video, sound, text etc. The action script will decide the way in displaying the frames of a SWF file.
The following features are available in Flashlite Player
Text and Fonts
Both System font as well as fonts embedded in SWF files can be supported. We can also input text using the SWF files. Dynamic and Static texts are also supported
Sound
Event sound and Streaming sound are supported by Flashlite Player. Compression options to control the quality of sound in exported SWF files can also be controlled
Device and Platform Integration
Flashlite provides access to several system features, to initiate phone calls and short message service messages, get platform capability information, and get user input using the device's standard input dialog box
Action Script Interpreter
Flashlite supports the version of the ActionScript language, including many mobile-specific commands like getting time and date information from the device
Network Connectivity
Flashlite supports the ability to load external data and SWF files, for getting connectivity and HTTP request status information
Core Rendering Engine
By making use of rendering engine, all vector and bitmap rendering can be handled

Flashlite 2.0 Player Architecture
The above diagram shows the Flashlite 2.0 player architecture in general. The Flashlite 2.0 Player contains FI (Flash Interface) and SI (System Interface) functions indicating API defined by the Flashlite player for invocation by the host application and API which must be implemented by the host application for the Flashlite player respectively.
Basic interactions required between the host application and the player are categorized as follows
- Overall control and interaction
- Network policy and access
- Keyboard input
- Mouse/Stylus input
- Time interface
- Device font selection interface
- Device text rendering interface
- Additional playback control
- Error notification and reporting
- Sound interface
- Vibrate interface
- Device integration interface
The following steps elaborate the creation of Flashlite Player instance and its usage.
Player Instance
The Flashlite player instance can be created by FI_CreatePlayer(). If successful it returns a pointer to the player instance. Before creating the player instance, we have to pass the setup configuration flags like navigation Model, memory model. In addition we have to set the function pointers for the SI_Functions to be used by the player.
Setting Frame Buffer and Display Rect
FI_SetFrame() is used for off screen frame buffer creation. Flashlite supports different frame buffer formats with which the size of the frame buffer can be calculated. The default frame buffer format is RGB565, 16 bit per pixel. FI_SetDisplayRect() is used to define the area where the player will expose the flash content.
Setting Device Capabilities
Player properties which include quality, background and looping along with device capabilities like stream sound, device sound etc can be set by enabling the corresponding options.
SWF File Loading
The selected SWF file is opened, buffer is allocated to load its content and FI_SetSWFDataBuffer is called to set the data buffer with the specified content. Before calling the FI_DoPlay() the content collected from the SWF file should be cross checked to ensure the validity of the data buffer by calling FI_CheckSWFDataBufferValidity(), which will check for the below conditions.
- Signature – should be "CWS/FWS"
- Header length – should be exactly 8 bytes
- Content length – should match the length specified in the header
- Frame Rate – should be valid (no negative values)
Based on the specified movie rate of the selected SWF file, FI_DoPlay() will be called periodically. The device context should be contacted for the purpose of onscreen painting.
Player Instance Destruction
The created player instance will get destroyed by placing a call to the FI function FI_DestroyPlayer(), which performs internal cleanup of associated memory resources like frames, memory buffer etc.
S60 Series – Developer Tools
The S60 series is based on Symbian OS V7.0. Symbian OS allows manufacturers to produce a range of phones in different styles using different user interfaces. S60 (formerly known as Series 60) is also a User Interface consisting of a suite of libraries and standard applications. S60 is intended to provide fully-featured mobile phones with large colour screens, which are most often referred to as "Smart Phones".
The S60 SDK provides the basic Application Programming Interface (API) functions, compilation tools and tools to package the files into the required formats.
Symbian S60 based Mobile Phones
Series 60 Developer Platform
Based on
Mobile Phone
Series 60 Developer Platform 1.0
Symbian OS v6.1
- Nokia 7650
- Nokia 3650/3600
- Nokia 3660/3620
- Nokia N-Gage
- Nokia N-Gage QD
- Sendo X
- Siemens SX1
Series 60 Developer Platform 2nd Edition
Symbian OS v7.0s
Nokia 6600
Series 60 Developer Platform 2nd Edition with Feature Pack 1
Symbian OS v7.0s enhanced
- Nokia 6260
- Nokia 6620
- Nokia 6670
- Nokia 7610
- Panasonic X700
- Samsung SGH-D710
Series 60 Developer Platform 2nd Edition with Feature Pack 2
Symbian OS v8.0
Nokia 6630
Symbian OS Architecture with S60 SDK
Symbian OS architecture is designed to meet a vide variety of requirements from the end users. It should be hardware independent, so that it can be used on a variety of phone types, and also it should be extendable, so that it can cope with future developments, and it must be open to all for developing.
Application Architecture
Symbian OS has an application architecture that helps developers in managing the complexity of Graphical User Interface (GUI) based applications. The application architecture has a built-in Active Scheduler so that developers don't need to understand the background details of the Active Object System when writing normal applications.

The basic functionality of an application and the interface needed for the platform framework to drive the application are the four major classes.
- Application class
- Application UI class
- Application Document class
- Application View Class
The core Symbian OS UI framework is called "Uikon". One of the most important libraries within the UI framework is "eikcore.dll", which contains the UI framework classes such as
- CeikApplication
- CeikAppUI
- CEikonEnv
S60 extend the framework by adding libraries to provide platform-specific controls. The S60-specific library is called Avkon and UIQ-specific library is called Qikon.
When creating a UI application, we will derive from base classes supplied by the platform-specific libraries (which themselves usually derive from classes in the Symbian OS framework), and call framework functions specific to the platform. For this we have to include the appropriate header files and link against libraries accordingly.
Every Symbian OS GUI application, regardless of the UI platform on which it is based, will use the application framework architecture, which means it will derive from a particular set of UI-specific classes.
Application
An object of this class is the first to be created by the GUI framework when the application starts. When instantiated, the object is used to identify the application, by returning its UID. It also creates the application's document class.
Application Document
The document class handles any persistent non-GUI data for the application and instantiates the application UI class.
Application UI
The application UI handles UI events generated from the user's actions (except low-level touch screen events and alphanumeric keyboard input). It also instantiates the application's default view.
Application View
This is the root GUI control which activates the main application window and acts as a container for other controls used.
Flash Porting
Flash porting on Symbian S60 SDK will involve the below mentioned steps
- Setting up the Symbian Series 60 development environment will be the first step in porting Flashlite, which is available from Forum Nokia. We can choose the particular version of the SDK based on our requirements. And for this porting S60 SDK 2nd edition was used
- Carbide, C++ and CodeWarrior are IDEs used in developing and building the application with the help of emulators. Microsoft Visual Studio can also be used in creating and building applications, where we can test using the emulator
- EPOC MakMake Makefile Project (.mmp) is a text file which performs the task of a makefile by including target, source, libraries with which the application should be developed. This file requires a unique Symbian OS application UID
- Application requires to be modified in softkey handling if it contains any touch screen implementation which S60 won't support by default.
- Display screen size as well as memory usage should be analyzed since S60 contains restricted stack memory
- Implementation of the functionalities based on the application in accordance with the relevant S60 APIs should be done
- Emulator can be used to check the developed application in fixing the issues and the performance of the developed application
Symbian APIs and FI/SI Functions
Elapsed Time
To calculate the elapsed time periodically between FI_DoPlay (), in order to limit the processing time and to ensure synchronization in Flashlite player SI_GetTime () can be used.
FI/SI Function
Symbian API
SI_GETTIME
HAL::Get(HALData::ESystemTickPeriod, timePeriod));User::TickCount() * timePeriod
Font Metrics
Font metrics to estimate the area occupied by text string
FI/SI Function
Symbian API
SI_GetFontmetrics
- CFont::AscentInPixels()virtual TInt AscentInPixels()Gets the ascent of the font in pixels
- CFont::DescentInPixels()virtual TInt DescentInPixels()Gets the descent of the font in pixels
- CharWidthInPixels()Virtual Tint CharWidthInPixels TChar aChar
Gets the width in pixels in this font of the specified character
Text Width
Computes the total width of the text string in pixels. Width is needed for formatting center and right justification.
FI/SI Function
Symbian API
SI_GetTextWidth
CFont::TextWidthInPixels()Virtual TInt TextWidthInPixels (const TDesC& aText) const=0;
Based on the selection of the default font the text width can be calculated as above
Character Information
Bitmap information for a specific character.
FI/SI Function
Symbian API
SI_GetCharacterInfo
CFont::GetCharacterData()virtual TCharacterDataAvailability GetCharacterData(TUint aCode,TOpenFontCharMetrics& aMetrics, const TUint8*& aBitmap,TSize& aBitmapSize) const;
Gets the metrics for a particular character
Text Draw
Renders text string to display frame buffer using the current selected font.
FI/SI Function
Symbian API
SI_DeviceTextOut
void DrawText(const TDesC& aText, const TPoint& aPosition);functions CGraphicsContext::DrawText()CFbsBitGc::DrawText()
Destroy Font
This will delete all the dependant fonts.
FI/SI Function
Symbian API
SI_DestroyFont
Cfont::DiscardFont()Void DiscardFont();
The selected font in the off-screen bitmap device context can be deleted
Font Selection
The font for the off-screen bitmap device context can be selected. Cause the device font object identified by font ID to become active font.
FI/SI Function
Symbian API
SI_SelectFont
CFont::UseFont()TInt UseFont(TInt aFontHandle);
For drawing text, selects device font identified by the handle number
If no font has been selected, and an attempt is made to draw text with DrawText(), then a panic occurs
Battery Level
Get current battery level of the device.
FI/SI Function
Symbian API
SI_GetBatteryLevel
RsystemAgent::GetState()TInt GetState(TUid aUid);
Get the value of the state variable identified by the specified UID
Power Source
Get the current power source of the device.
FI/SI Function
Symbian API
SI_GetPowerSource
HAL::Get(HALData::EPowerExternal, External)HAL::Get(HALData::EPowerBackup, Backup)
check whether the power source is external or backup
Language
To retrieve the current language available in the device.
FI/SI Function
Symbian API
SI_Getlanguage
User::Language()static TLanguage Language();
Returns the language of the current locale
Device Identifier
To get the unique identifier of the device
FI/SI Function
Symbian API
SI_GetDeviceID
PlpVariant::GetMachineIdL (TPlpVariantMachineId id);
To get the IMEI number of the device
Model Identifier
To identify the device model on which the Flashlite player is running.
FI/SI Function
Symbian API
SI_GetDevice
HAL::Get(HALData::EManufacturer, manufacturer)
Testing
EPOC emulator which is present in the Series 60 SDK is used for the entire porting purpose.

Conclusion
Symbian S60 SDK provides many features for the developers and this has helped to port the Flashlite 2.0 Player application to this particular series of Symbian SDK.

