Creating the MP3 Player application demo
18 Pages
English

Creating the MP3 Player application demo

-

Downloading requires you to have access to the YouScribe library
Learn all about the services we offer

Description

Tutorial
October 2009
Creating the MP3 Player
application demo
with Sony Ericsson Flash Lite™ UI components Tutorial | MP3 Player application demo
Preface
About this tutorial
This tutorial demonstrates how Sony Ericsson UI components can be used to create real interactive
mobile applications and also gives a general overview of Project Capuchin.
Sony Ericsson Developer World
At www.sonyericsson.com/developer, developers find the latest technical documentation and
development tools such as phone White papers, Developers guidelines for different technologies, Getting
started tutorials, SDKs (Software Development Kits) and tool plugins. The Web site also features news
articles, go-to-market advice, moderated discussion forums offering free technical support and a Wiki
community sharing expertise and code examples.
For more information about these professional services, go to the Sony Ericsson Developer World Web
site.
This document is published by Sony Ericsson
This Tutorial is published by: Mobile Communications AB, without any
warranty*. Improvements and changes to this
text necessitated by typographical errors, Sony Ericsson Mobile Communications AB,
inaccuracies of current information or SE-221 88 Lund, Sweden
improvements to programs and/or equipment,
may be made by Sony Ericsson Mobile
www.sonyericsson.com/ Communications AB at any time and without
notice. Such changes will, however, be
incorporated into new editions of this document. © Sony Ericsson ...

Subjects

Informations

Published by
Reads 136
Language English
Tutorial
October 2009 Creating the MP3 Player application demo with Sony Ericsson Flash Lite™ UI components
Preface
About this tutorial
Tutorial | MP3 Player application demo
This tutorial demonstrates how Sony Ericsson UI components can be used to create real interactive mobile applications and also gives a general overview of Project Capuchin.
Sony Ericsson Developer World
At www.sonyericsson.com/developer , developers find the latest technical documentation and development tools such as phone White papers, Developers guidelines for different technologies, Getting started tutorials, SDKs (Software Development Kits) an d tool plugins. The Web site also features news articles, go-to-market advice, moderated discussion forums offering free technical support and a Wiki community sharing expertise and code examples. For more information about these professional services, go to the Sony Ericsson Developer World Web site.
This document is published by Sony Ericsson This Tutorial is published by: Mobile Communications AB, without any warranty*. Improvements and changes to this Sony Ericsson Mobile Communications AB, text necessitated by typographical errors, inaccuracies of current information or SE-221 88 Lund, Sweden improvements to programs and/or equipment, m/ may be made by Sony Ericsson Mobile www.sonyericsson.co Communications AB at any time and without notice. Such changes will, however, be © Sony Ericsson Mobile Communications AB, incorporated into new editions of this document. Printed versions are to be regarded as temporary 2 0li09. All  rtiog hdtos wrensloeravde adn. dY/ooru  parrien t hae rceobpyy  gorfa tnhtiesd  reference copies only. a cense document. *All implied warranties, including without Any rights not expressly granted herein are limitation the implied warranties of reserved merchantability or fitness for a particular . purpose, are excluded. In no event shall tion (October 20 ) Sony Ericsson or its licensors be liable for First edi 09 incidental or consequential damages of any Publication number: 1233-4351.1 nature, including but not limited to lost profits or commercial loss, arising out of the use of the information in this document.
2
October 2009
Contents
Tutorial | MP3 Player application demo
Introduction .................................................................................................................5 Skill level ................................................................................................................... .5 Requirements ............................................................................................................5 Content of the zip file ................................................................................................7 UI components used in this tutorial ..........................................................................7 Tutorial ...................................................................................................................... ...8 Creating the application ............................................................................................8 Frame 1 – Main screen ........................................................................................10 mcPlayer Frame 1 – Player definitions ................................................................13 mcPlayer Frame 2 – Player startup ......................................................................15 mcPlaylist Frame 1 – Songs playlist ....................................................................16 Testing .....................................................................................................................18
4
October 2009
Introduction
Tutorial | MP3 Player application demo
This tutorial shows how to use Sony Ericsson Flash Lite™ 2.0 UI Components in developing real mobile applications. The MP3 Player application lists MP3 files in the “music” folder on the memory card in the phone, builds a playlist and gives the user possibility to play a selected song or go to next/previous song. The following data is displayed for the song being played: ID3 tag (if available), music length and remaining time. Note : Support for Project Capuchin is required for the application to run on the phone. A list of phones supporting Project Capuchin can be found at: http://developer.sonyericsson.com/device/ searchDevice.do?defaultSearch=true&attributes=e3b7531a-468c-40c5-9e54-8b1ce192ebb3 . To see the final demo app lication, test the MP3Pla yer.jar and MP3Player.jad files in your Capuchin enabled phone. For more information about testing, see “Testing” on page 18.
Skill level
Intermediate – Good skills in Action Script 2.0. Adva nced skills in Adobe Flash CS3 or CS4 IDE.
Requirements
The applications and tools required to execute this tutorial are listed below. Adobe Flash CS3/CS4 A multimedia authoring application used to create web applications, games, movies, and content for embedded devices. It features support for ve ctor and raster graphics and ActionScript. http://www.adobe.com/products/flash/ • Adobe Extension Manager Adobe tool devoted to install new extensions for Adobe Flash CS3/CS4. http://www.adobe.com/exchange/em_download/ Java runtime environment (JRE) The latest version of JR E and installation instru ctions are available at http://www.java.com/en/download/manual.jsp Sony Ericsson UI Components The Sony Ericsson UI components are available at http://developer.sonyericsson.com/site/global/docstools/flashlite/p_flashlite.jsp . Install them using the Adobe Extension Manager and read the help documentation for further information on applic ation architecture.
5
October 2009
Tutorial | MP3 Player application demo
The Soft Keys labels vary when the playlist view is loaded or when the song state (playing or paused) changes. This modification during runtim e is possible using ActionScript code. The code below shows the customisation of MSK when the song starts to play: _ _ softKeys sks. MSK = "Pause"; The following table shows all the values that each soft key can assume in the application: LSK label MSK label RSK label Application starts "Playlist" "Play" "Back" mcPlayer view is loaded "Playlist" "Play" "Back" A song starts to play with mcPlayer view "Playlist" "Pause" "Back" loaded A song is paused with mcPlayer view "Playlist" "Play" "Back" loaded mcPlaylist view is loaded "" "Play" "Back" The Soft Keys component dispatches two events when any soft key is selected: onSoftKeyDown (when a Soft Key is pressed) and onSoftKeyUp (when a Soft Key is released). This application uses the onSoftKeyDown event with the following structure to respond to user interaction: _ _ softkeys sks.onSoftKeyDown = softkeys sksPressed; function softkeys_sksPressed(softkey:String):Void { switch(keyPressed) { case "LSK": // Left soft key actions. break; case "MSK": // Middle soft key actions. break; case "RSK": // Right soft key actions. break;  } } The function of each soft key may vary according to the selected view, since the views can redefine the Soft Keys onSoftKeyDown event handler. The openScreen method allows the user to switch between views. The following code is implemented on the left soft key of main frame 1: openScreen("Playlist"); If the application does not have songs to play, LSK and MSK are disabled to avoid unauthorised interactions:
11
October 2009