BREW 2006 Technical session 501
ss">
1
Creating Flash Applications on
BREW
®
Handsets
Rupen Chanda, Computer Scientist
Adobe Systems Inc.
2
Todays Topics
Introduction to Flash Lite & the BREW Extension
Flash Lite BREW Extension Architecture
Flash Lite BREW Extension Capabilities
Content Development Process
Demo Flash Lite BREW Extension
3
Introduction
4
Adobe Flash Lite
What is Flash Lite?
The Flash profile designed and developed for Mobile and Embedded
Devices
Provides rich user experiences
More than 65 million Flash-enabled devices shipping worldwide
Optimized for resource constrained devices
Allows content author to access device specific capabilities
Supports same SWF file format as Flash Player 7 for the desktop
5
The Flash Mobile Platform
Authoring Tool
Content creation tool
Can import various
media types like
images, sound,
video, etc.
Mobile device
simulation
SWF File Format
Designed to deliver
rich user experiences
over slow dial-up
connection
Open file format
Compact, efficient
binary format
Tag based, flexible
Flash Player
Developed to keep
the binary size as
small as possible
Has rich graphical
and multimedia
experience
Virtual machine that
plays back SWF file
6
Flash Lite BREW Extension
Flash Lite BREW Extension enables Flash content
and applications to run on select BREW handsets
Flash Lite BREW extension is
Based on Flash Lite 2.x.
Supports BREW 2.1.3 or above
7
Flash Lite BREW Extension Content Type
Application
Content Catalog
Content
Branded App
Screen Saver Catalog
Screen Saver
8
Flash Lite
BREW Extension Architecture
9
Flash Lite BREW Extension: Architecture
Three components for Flash Lite BREW content
development:
Flash Professional Authoring tool with Flash Lite BREW
Post Processor capable of generating BREW compliant
*.mod file
Flash Lite BREW Projector Application (includes content
specific *.mod file and *.MIF file)
Flash Lite BREW Extension
10
BREW Framework
Input Text
Device Image
(Codec)
Device Text
Device Video
(Codec)
Device Audio
(Codec)
Device Content
JPEG
Vector
Font
Data
SWF
Audio
Dy
namic Data
(SWF, XML, Data
)
Persistent Data
ECMA based
ActionScript
Engine
1.1/2.0
Device
Capabilities
& Info
Core Rendering Engine
Gradients
Vectors
Embedded
Text
Bitmap
Images
Frame Buffer
Events
Network Data
Video
11
Flash Lite Content Playback Flowchart
User downloads
FlashLite Projector
Application from ADS
FlashLite BREW
extension is
downloaded
User starts
FlashLite
Projector
Application
FlashLite Projector
Application Loads
FlashLite BREW
Extension
FlashLite BREW
Extension is
Initialized
FlashLite Projector
Application provides SWF
data to the FlashLite
Extnesion
FlashLite BREW
extension initializes it
internal Frame Buffer
FlashLite BREW
extension starts its
internal timer
FlashLite BREW
extension starts
parsing and playing
back the SWF file
(continued)
12
Flash Lite Content Playback Flowchart
13
Flash Lite BREW Extension
Capabilities
14
Flash Lite Extension: Capabilities
Basic Functionality
Playing back SWF content
Rendering graphics and images
Bitmap (BMP)
JPEG, PNG and other device supported formats
Rendering fonts/text
Device font
Anti-aliased font
Pixel/Raster font
15
Flash Lite Extension: Capabilities
(continued)
Basic Functionality
Process and executes ActionScript (ECMA-262 standard
based script like Java Script)
Playback animations
Can natively render onto the screen supporting various bit
depths (like 8 bit palette mode, RGB 444, RGB 555, RGB
565, RGB 666, RGB888 etc.)
Flexible rendering quality: Low, high, medium (most suitable
for mobile devices)
16
Flash Lite Extension: Capabilities
(continued)
Basic Functionality
Supports suspend, resume of content playback
Content can be Panned and Zoomed
Capable of running on both MBCS and UTF16 based
devices
Can render Unicode content/text
Can render content with or without Full-Screen mode (can
be controlled by Action Script)
17
Flash Lite Extension: Capabilities
(continued)
User Input Events:
Handles Key Events (Key down, Key, Key up)
Can support stylus based input
Flexible event handling: Content author can write custom
event handling code
Player provides default navigation mechanism among the
controls on the screen
Customizable navigation using Action Script
Provides inline text entry functionalities to the content
18
Flash Lite Extension: Capabilities
(continued)
Network Communication
Allows content author to make HTTP/s network requests to
the arbitrary HTTP server and stream data to the player
Content can load other SWFs (via Action Script: loadmovie)
Content can load data like text data, XML data etc. (via Action Script:
loadvariable)
Can load various types of images and sound data (via loadmovie)
Action Script can register for network communication events, such as
OnConnect
OnLoad
19
Flash Lite Extension: Capabilities
(continued)
Network Communication
Example of loadmovie Action Script
loadmovie (
http://www.adobe.com/test/products.swf
, _root.dropzone);
In the above Action Script: there is an invisible movie clip on the stage
with the instance name dropzone. The loadmovie action uses this
movie as target parameter to load the products.swf
Can unload movie using unloadmovie
20
Flash Lite Extension: Capabilities
(continued)
Socket Communication
Permits XML based socket to send and load XML data
XML messages are sent over a full-duplex TCP/IP stream socket
connection
Each XML message is a complete XML document, terminated by a
zero byte
An unlimited number of XML messages can be sent and received
over a single XMLSocket connection
Has various Action Script event handlers, such as,
OnConnect
OnClose
OnData
21
Flash Lite Extension: Capabilities
(continued)
Security
Root SWF movie path is the base URL of the content
Restricts any cross-domain data loading, for example
If root movie URL is set to
http://www.adobe.com
Doesnt allow the content author to load additional content from
http://www.xyz.com
22
Flash Lite Extension: Capabilities
(continued)
Sound Playback
Two types sound playback mode:
Event: Audio and animation is not synchronized
Achieve pseudo synchronization: Can be turned on using Action Script
Synchronous/Streaming: Audio and animation is synchronized (not
possible in the current generation of BREW device due to system
limitation)
Can load/playback various sound formats: like MIDI, SMAF,
AAC, AACPlus etc. Device dependent
Pause, Resume etc.
23
Flash Lite Extension: Capabilities
(continued)
Video Playback
Three modes of video data playback:
Video data bundled (embedded) in the SWF
Video data available as a separate file on the device
Video data streamed in over the network
Video object in the Action Script controls video playback
Player supports all the video formats supported by the
device
Flash video format and streaming from Flash Media
Server - Not supported
24
Flash Lite Extension: Capabilities
(continued)
Shared Object
Is an Action Script class that allows reading and writing of
data to the disk. In desktop player SWF movies can share
their data, however in mobile shared object doesnt allow
sharing data between different Flash Movie instances
For a given main SWF movie shared object size is limited
to 4KB
Maximum limit of total shared object space is 256KB
For example, user search string preference
25
Flash Lite Extension: Capabilities
(continued)
Device Integration Functionalities:
Flash Lite BREW extension offers various device specific
integration functionalities at the Action Script level
System.capabilities: Provides device specific capabilities information
Various time related functionalities: GetDateDay, GetDateMonth,
GetLocaleLongDate, GetLocalShortDate etc.
Vibration capability: Dependent on device support
Can retrieve device specific ISO-639-1 standard language code, and
optional ISO-3166 standard country code
Can access device identifier
26
Flash Lite Extension: Capabilities
(continued)
Device Integration:
Not Supported in BREW 2.x, due to system limitations:
Battery Level,
Backlight control,
Power source information,
Network connection status,
Signal level information
27
Flash Lite Extension: Capabilities
(continued)
Device Integration:
Can Launch arbitrary application like web browser with by
specifying URL (dependent upon the target application
registering its MIME type with BREW) or class ID
Can send SMS, can initiate phone call, sending email (if any
email client is registered with BREW, otherwise sends SMS)
Has ability to integrate with VCast, MobileShop
®
etc.
28
Content Development Process
29
Flash Lite BREW Content Development Process
Start
Content Author buys
Adobe Flas