Guidelines for porting Flashlite Player on Symbian Series 60 based Devices

Page created by Claude Fletcher
 
CONTINUE READING
Guidelines for porting Flashlite Player on Symbian Series 60 based Devices
WHITE PAPER

                   Guidelines for porting
            Flashlite Player on Symbian Series
                     60 based Devices

The document details the porting of Flashlite 2.0 Player to Symbian S60 based
devices. This document briefly discusses on S60 Software Development Kit (SDK),
development environment and details on Flashlite 2.0 porting.

The document is meant for the exclusive preview of the management of Calsoft Labs
and chosen reviewers from the industry. It reflects Calsoft Labs’ continuing
commitment to the business community to offer its thoughtful voice on what is newly
learned, what is to be taken care of and what truly matters while deciding upon on
strategic IT solutions.

The information contained in this document is proprietary & confidential to Calsoft Labs.

                                                                                            Engineering & Technology Consulting
Guidelines for porting Flashlite Player on Symbian Series 60 based Devices

                       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,                 A Symbian OS Application
                       UIQ and S90, of which
                                                                   Application
                       S60 and UIQ SDKs are
                       widely used. S90 SDK is
                       amalgamated with S60                        Document            Data Model

                       SDK.
                       Symbian OS is a                User      User Interface with            View(s)
                                                   Interface    command handler
                       feature-rich operating
                       system that supports

                                                                A Symbian OS Application
Table of Contents
                                                 graphics and audio, multimedia applications. The
Abstract                                 01      communication protocol can be serial communication
                                                 via Bluetooth/infrared, and network communication
Introduction                              02     using the TCP/IP protocol (IPv6 is supported).
About Symbian OS                         02      Telephony and messaging are also available with
                                                 support for Multimedia Messaging Service (MMS).
About Flashlite 2.0 Player                03
                                                 About Symbian OS
Flashlite 2.0 Player Architecture 04             In general, the Symbian OS components are classified in
                                                 such a way that they ensure maximum interportability
S60 Series – Developer tools             05      between all products containing Symbian OS. The below
                                                 classification is a simplified version of the system
Symbian OS Architecture                          definition:

with S60 SDK                             06      Common Symbian
                                                 Common Symbian components should be present in
Flash Porting                            07      every phone for building of the Core part of Symbian and
                                                 to export a public API that is maintained across all
Symbian APIs and FI/SI                           phones based upon the same Symbian OS version. The
Functions                                08      code written for the published API should compile and
                                                 run without errors on all such phones. The core API and
Testing                                   10     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.

                                                                             Engineering & Technology Consulting
Guidelines for porting Flashlite Player on Symbian Series 60 based Devices

             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 av.ailable 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         Flashlite provides access to several
                      Integration                 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               Flashlite supports the version of the
                      Interpreter                 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              By making use of rendering engine, all
                      Engine                      vector and bitmap rendering can be
                                                  handled

                                                                   Engineering & Technology Consulting
Guidelines for porting Flashlite Player on Symbian Series 60 based Devices

                          Frame Buffer                       Events

                                                                                           Input
                                                                                            Text

                         Core Rendering                       Vector                      Device
                             Engine                            Font                       Image
                                                               Data
                                             ActionScript

                                                                                                                      (SWF, XML, Data)
                                                                                                    Persistent Data

                                                                                                                       Dynamic Data
                                                                           Network Data
                                               Engine                                     Device
                                                1.1/2                                      Text
                        SVG-T
                                                                                          Device
                                                               JPEG                       Video
                       Gradients   Vectors
                                                                                          Device
                                                                                          Audio
                                               Device          SWF
                                   Bitmap
                      Embedded               Capabilities     Audio                       Device
                        Text       Images
                                              and Info                                    Content

                                             Mobile Phone / Device Operating System

             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

                                                                                Engineering & Technology Consulting
Guidelines for porting Flashlite Player on Symbian Series 60 based Devices

           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 buf fer 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   Symbian OS v6.1        Nokia 7650
                       Platform 1.0                                 Nokia 3650/3600
                                                                    Nokia 3660/3620
                                                                    Nokia N-Gage
                                                                    Nokia N-Gage QD
                                                                    Sendo X
                                                                    Siemens Sx1

                                                                     Engineering & Technology Consulting
Guidelines for porting Flashlite Player on Symbian Series 60 based Devices

                        Series 60 Developer
                        Platform                         Based on                        Mobile Phone

                        Series 60 Developer              Symbian OS v7.0s                Nokia 6600
                        Platform 2nd Edition
                        Series 60 Developer              Symbian OS v7.0s                Nokia 6260
                        Platform 2nd Edition             enhanced                        Nokia 6620
                        with Feature Pack 1                                              Nokia 6670
                                                                                         Nokia 7610
                                                                                         Panasonic X700
                                                                                         Samsung SGH-D710
                        Series 60 Developer              Symbian OS v8.0                 Nokia 6630
                        Platform 2nd Edition
                        with Feature Pack

             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.
             Symbian OS Architecture
                                                 Symbian OS Architecture with S60 SDK

                          License Platforms
                                              S60      AVKON           S60         AVKON

                          UI Framework
                                              UI Application Framework
                              UI ToolKit
                                                 UIKON       UILAF      CONE       FEP Base       Java J2ME

                          Application Services

                           PIM and Messaging and        Office       Data Sync     Application
                                   other               Engines        Support      Framework

                           PIM and Messaging App           Internet and              Printing
                                  support             Web Application Support        Support

                          OS Services

                                              Serial Comma and           Graphics      Generic
                                              Short Link Services        Services      Services

                                                 Telephony     Networking        Connectivity
                                                  Services      Services          Services

                          Base Services

                          Kernel Services and Hardware Interface

             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

                                                                                      Engineering & Technology Consulting
Guidelines for porting Flashlite Player on Symbian Series 60 based Devices

               +   Application class
               +   Application UI class
               +   Application Document class
               +   Application View Class
             The core Symbian OS UI framework is called “. One of the most important libraries
             within the UI framework is “, 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 and UIQ-specific library is called .
             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:
               1. 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.
               2. 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.
               3. 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.

                                                                 Engineering & Technology Consulting
Guidelines for porting Flashlite Player on Symbian Series 60 based Devices

               4. Application requires to be modified in softkey handling if it contains any touch
                  screen implementation which S60 won’t support by default.
               5. Display screen size as well as memory usage should be analyzed since S60
                  contains restricted stack memory.
               6. Implementation of the functionalities based on the application in accordance
                  with the relevant S60 APIs should be done.
               7. 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

                                                                  Engineering & Technology Consulting
Guidelines for porting Flashlite Player on Symbian Series 60 based Devices

             Character Information
             Bitmap information for a specific character.

                         FI/SI Function       Symbian API

                        SI_GetCharacterInfo   CFont::GetCharacterData()virtual
                                              TCharacterDataAvailability Get Character
                                              Data(TUint aCode,TOpen Font CharMetrics
                                              & 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

                                                                   Engineering & Technology Consulting
Guidelines for porting Flashlite Player on Symbian Series 60 based Devices

              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        (TPlpVariant
                                              MachineId 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.

                                                                   Engineering & Technology Consulting
Guidelines for porting Flashlite Player on Symbian Series 60 based Devices

                                                          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.

   For more information on this
   project or our related services,                       About Calsoft Labs
   contact us through our web site,                       Calsoft Labs provides specialized concept to market Product Engineering services
   www.calsoftlabs.com                                    to product and technology companies in select market segments. Our target
                                                          markets include Automotive, Consumer Electronics, Media, Networking, Storage
                                                          and Independent Software Vendors (ISVs). Calsoft Labs delivers unmatched
                                                          business value to its customers through a combination of process excellence,
                                                          reusable frameworks and technology innovation.

                                                          Calsoft Labs is a wholly owned subsidiary of ALTEN. Set up in 1988, ALTEN is a
                                                          European leader in Engineering and Technology Consulting (ETC) with 15,000
                                                          employees in over 14 countries worldwide.

USA                                                       INDIA                                                       FRANCE
2953 Bunker Hill Lane, Suite 203, Santa Clara, CA 95054   196, Bannerghatta Road, Arekere Circle Bangalore - 560076   40 avenue André Morizet, 92514 Boulogne-Billancourt, France
Phone : +1 925 249 3000 - Fax : +1 408 755 3000           Phone : +91 80 4034 3000 - Fax : +91 80 2648 5108           Phone : +33 (0)1 46 08 70 00 - Fax : +33 (0)1 46 08 70 10

                                                                                                                                 Engineering & Technology Consulting
You can also read