WindowsMobile_vs_SymbianOS

573 views

Published on

Published in: Design, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
573
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

WindowsMobile_vs_SymbianOS

  1. 1. HELSINKI UNIVERSITY OF TECHNOLOGY 3.12.2004Telecommunications Software and Multimedia LaboratoryT-111.550 Multimedia SeminarFall 2004: Mobile Multimedia Application Platforms Microsoft Windows Mobile vs. Symbian Multimedia Juhani Nokela, 49539H Onni Valkeapää, 51505T
  2. 2. Abstract This paper introduces the Windows Mobile and Symbian OS platforms and compares their multimedia capabilities. It shows that although both platforms can perform basic tasks related to multimedia (e.g. audio playback) their features are more constrained when it comes to playing video or drawing more than just basic graphics. The paper also shows that the basic working model behind the platforms is fundamentally different from each other; being a company owned by six large mobile phone manufacturers, Symbian targets at more open software development, while Windows Mobile is strictly controlled by one company, that is, Microsoft. In the beginning of the paper a broad overview of the background of the technologies is given and after that a more detailed technological description is provided. The comparison of the technologies is done using simple programming examples. Finally main findings are summarized.TABLE OF CONTENTS 1 Introduction .......................................................................................................... 2 2 Background........................................................................................................... 2 2.1 Microsoft Windows Mobile ......................................................................... 2 2.2 Symbian OS .................................................................................................. 2 3 Technology description ........................................................................................ 3 3.1 Microsoft Windows Mobile ......................................................................... 3 3.1.1 .NET Compact Framework................................................................... 3 3.1.2 Microsoft Smartphone .......................................................................... 4 3.1.3 APIs for Microsoft Smartphone............................................................ 5 3.1.4 Windows Media Player......................................................................... 5 3.2 Symbian OS .................................................................................................. 5 3.2.1 Symbian OS v7.0s ................................................................................ 5 3.2.2 Multimedia Framework (MMF) ........................................................... 7 3.2.3 Future: Symbian OS v8.0 ..................................................................... 8 4 Comparisons, Programming examples ................................................................. 9 4.1 Audio ............................................................................................................ 9 4.1.1 Microsoft Smartphone: Playing and Recording Sounds....................... 9 4.1.2 Symbian OS v.7.0: Playing and Recording Sounds............................ 10 4.2 Video .......................................................................................................... 12 4.2.1 Video playback in Microsoft Smartphone.......................................... 12 4.2.2 Video playback in Symbian OS v.7.0................................................. 13 4.3 Graphics...................................................................................................... 13 4.3.1 Graphics in Microsoft Smartphone..................................................... 13 4.3.2 Graphics in Symbian OS v.7.0s.......................................................... 13 4.4 Games ......................................................................................................... 14 4.4.1 Smartphone Game Programming ....................................................... 14 4.4.2 Symbian OS v.7.0 game programming............................................... 15 5 Summary............................................................................................................. 16 1
  3. 3. 1 INTRODUCTION This paper gives an overview of the technologies used in Microsoft Windows Mobileand Symbian OS software platforms. It focuses on the multimedia features of bothsystems and provides a comparison between them. Because the Symbian OS is primarilyused in devices closely resembling more conventional mobile phones, the paper focuseson Windows Mobile’s Smartphone platform, which is targeted at the same kind ofdevices. The paper first discusses the operating system related features and after that,moves on to multimedia. At the end of the paper, simple programming examples areused to demonstrate the multimedia capabilities of systems.2 BACKGROUND2.1 Microsoft Windows Mobile Windows Mobile [14] is Microsoft software platform for Pocket PCs and sSmartphones. It is designed to extend the familiarity of the Windows desktopenvironment to mobile devices, in terms of system development and usability. WindowsMobile is based on Windows CE operating system [34], which has been a stepping-stone for Microsoft to mobile systems. There are currently three versions of Windows Mobile on the market: WindowsMobile 2002, Windows Mobile 2003 and Windows Mobile 2003 Second Edition. Themost significant difference between the versions 2002 and 2003 is the latter’s supportfor Microsoft’s .NET Framework [12], which is a managed execution environment forapplications. In mobile devices, a scaled-down version of .NET Framework is used. Thenewest version of Windows Mobile, i.e. Windows Mobile 2003 Second Edition, isbased on Windows CE version 4.21. At the time of writing, Windows CE 5.0 is on itsway to markets. Along with the new version, comes an updated version of .NETCompact Framework [21].2.2 Symbian OS Symbian OS is an open operating system for mobile phones. It is designed to work inenvironment set by 2G, 2,5G and 3G mobile phone requirements. The operating systemis owned by a software licensing company called Symbian and in this is owned by someof the leading mobile phone manufacturers with following shares: [26] - Nokia 47,9 % - Ericsson 15,6 % - Sony Ericsson 13,1 % - Panasonic 10,5 % - Siemens 8,4 % - Samsung 4,5 % In addition to its owners the operating system has been licensed to six othercompanies that develop mobile phones around the world. Altogether these companiespromote 21 phones and more is coming out all the time. Maybe the most well knownSymbian phones are Nokia Communicator 9290, Nokia 7650, Sony Ericsson P800 andSiemens SX1. 2
  4. 4. At the moment there are three versions of Symbian shipping out in phones. The olderone, version 6.0 is slowly fading away, but still in use for example in NokiaCommunicators. More relevant versions for today’s mobile communication are version7.0 and especially version 7.0s. The biggest difference between versions 7 is that the s-version supports Java MIDP 2.0 and a completely new Multimedia Framework (MMF)is included [29]. Symbian has also released two new versions of the operating system,which are known as versions 8.0 and 8.1. For these versions there are only Nokia 6630phone out that include version 8.0.3 TECHNOLOGY DESCRIPTION3.1 Microsoft Windows Mobile3.1.1 .NET Compact Framework .NET Framework [12] is an integral Windows component for building and runningdifferent kinds of software, including web-based applications and XML Web services.Various programming languages can be used in .NET development by using compilersdesigned for .NET Framework. Core of the .NET Framework is composed of theCommon Language Runtime (CLR) and the Framework Class Libraries (FCL). Theformer is a programming language independent development and managed executionenvironment and the latter a set of prewritten services, which provide the basicfunctionality used in applications [37]. Fundamental working model of the .NET Framework and its CLR resemblesconcepts used e.g. in Java Virtual Machine [12]. CLR’s purpose is to execute the codewritten for it – no matter what programming language is used. In other words, eachCLR-compatible programming tool compiles its source code to a .NET executable,standardized Microsoft Intermediate Language (MSIL). When the application is finallyexecuted, .NET Framework transforms the semi-compiled MSIL-code into a nativecode. This phase is called just in time compilation [32]. The Common Language Runtime is a key element of .NET Framework. It serves as amediator that manages code at runtime and provides applications with basic services,ranging from memory management to security issues [37]. Applications developed for.NET Framework are knit together with the runtime, and their code is called managed[37]. Code that does not target the runtime, i.e. unmanaged code, can also benefit fromthe managed features by loading CLR into its processes [37]. .NET Compact Framework [21] is a mobile-oriented version of the full .NETFramework. It uses a subset of .NET Framework’s FCL, which is adapted to be usedwith mobile devices with constrained features and resources. To minimize the batteryconsumption, .NET Compact Framework is optimized to avoid heavy use of RAM andCPU cycles [37]. CLR of .NET Compact Framework is approximately 12 percent thesize of that used in full .NET Framework [22]. It is estimated, that MicrosoftSmartphone, which uses the .NET Compact Framework, holds about one third of the1500 interfaces used in traditional desktop Windows [32]. 3
  5. 5. Being a subset of .NET Framework, .NET Compact Framework allows theprogramming tools of desktop environments to be used in mobile system development.Clear benefit of this relationship is the ability to exploit more wide-spread programmingskills of desktop environments in mobile platform programming. On the contrary, as the.NET Compact Framework is more or less scaled-down version of the desktop system,some of the distinctive characteristics of mobile environment may not receive sufficientattention due to the changed purpose of use [32].3.1.2 Microsoft Smartphone Smartphone is a mobile device, which combines features and functionality of mobilephone and personal digital assistant (PDA). Microsoft Smartphone [36] is a softwareplatform, which is built on Windows Mobile and .NET Compact Framework. Microsoftalso offers a platform called Pocket PC, which is targeted at the PDAs and is similar tothe Microsoft Smartphone. The difference between a Smartphone and PDA stems fromtheir usage characteristics. Smartphone is primarily used as a mobile phone andtherefore the Microsoft Smartphone is well tuned for tasks such as messaging andmaking calls [21]. Unlike the PDA, it is also designed to be used with one hand. Currently, there are two development options available by Microsoft forprogramming Smartphone 2003. One is to write native code using Microsoft’sembedded Visual C++ 4.0 and the other is to write managed code through Visual Studio.NET 2003. In both cases, a Smartphone 2003 software developer kit (SDK) is needed.Figure 1 show the Smartphone emulator, which can be used to test applications.Figure 1: Microsoft Smartphone emulator 4
  6. 6. 3.1.3 APIs for Microsoft Smartphone Microsoft Smartphone platform provides system developers with set of APIsespecially designed to exploit the capabilities of Smartphone devices. Smartphone API[37] provides tools, among other things, for connectivity, messaging, telephony andmultimedia. Microsoft Smartphone’s multimedia-related APIs are listed in the table 1[37]. For each API, a short description of its key features is given.Table 1. Multimedia-related APIs of Microsoft SmartphoneAPI Key featuresGame API (GAPI) Game API provides functions and structures which are specially needed in games-programming. The most important features of GAPI are related to handling the device’s display and hardware keys.MIDI API MIDI API is used to play MIDI file in Smartphone device. File is played by converting it to a specific WAV-format.Vibrate API Vibrate API provides functions to control the vibration feature of the device. In Smartphone, vibration is defined as song, and with vibrate API song’s amplitude, frequency and duration can be controlled.Voice Recorder Control API Voice Recorder Control API is used to record voice and sounds. It contains a function, which is used to start and stop the recording as well as playing the sound recorded.3.1.4 Windows Media Player Windows Mobile 2003 includes Microsoft’s Windows Media Player (WMP) [35],which is an application used to play different kinds of audio and video files. There aredifferent versions of WMP, Smartphone 2003 uses the version 9 [35]. The WMP inSmartphone supports the Windows Media audio and video playback as well as MP3playback, but for example MPEG1 and AVI playback are not supported. Windows Media Player control is a set of APIs that can be used to add themultimedia playback capabilities of Windows Media Player to applications and webpages [35]. Windows Mobile 2003 supports the WMP ActiveX controls embedded inweb pages, but does not offer any WMP APIs to be used with applications [35].3.2 Symbian OS3.2.1 Symbian OS v7.0s Symbian operating system v.7.0s is an improved version of 7.0. Especiallymultimedia capabilities have been improved to the s-version. Some of they key aspectsof the whole operating system is, that it is fully multi-tasking and has an openapplication environment that supports some of the most common standards in theindustry (for example Java’s J2ME) [29]. The user interface has not been standardizedin Symbian, so all the manufacturers can develop their own. The most used user 5
  7. 7. interface in Symbian phones is Nokia’s Series 60 that has been licensed also outsideNokia [33]. Symbian has been designed especially for mobile phones, so all the different parts ofthe architecture have been thought that in mind. The architecture Symbian uses can befound from figure 2 [29] and from there can be seen, that telephony part has beenisolated from the other parts, so they won’t interfere with it.Figure 2: Symbian OS architecture For the developers the native language of Symbian is C++ and there is available forexample a development environment from Borland called C++BuilderX Mobile Edition1.5. In addition to C++ Symbian also supports Java in the Application framework [27].This framework supports different kind of user interfaces, internationalization and runsall the applications as separate processes as the operating system is fully multi-tasking[29]. Symbian offers to its licensees and development partners Symbian OS kit that isfocused for developing the applications with C++. The C++ used in Symbian is not apure C++, but its dialect called Symbian C++. For most of the users this is not aproblem, but with some old gcc versions there might be problems. Also somedifferences are in the memory allocation as the standard C++ is not efficient enough dueto the constraints in mobile devices [32]. In Java world Symbian supports MIDP v.2.0 with CLDC and in Communicators alsoPersonalJava with JavaPhone. The MIDP (The Mobile Information Device Profile) withthe CLDC (Connected Limited Device Configuration) are an integral part of Java 2Platforms Mobile Edition (J2ME) [24]. Together these ensure that standard Javaruntime environment can be used in Symbian phones and this gives wide range of 6
  8. 8. different Java APIs available to developers. MIDP also offers wide range of multimediasupport that will make developing different multimedia applications and games mucheasier. Sun has made a preannouncement that PersonalJava with JavaPhone will be soon inthe End Of Life (EOL) [25] and in the Symbian world it has been just in theCommunicators as it is much too heavy for lightweight mobile phones. In addition to C++ and Java supports OPL (Open Programming Language) thatSymbian has made open source. This language is supposed to be a powerful butrelatively easy programming language. It is a basic like language that has been used forover 60 applications in the open source community [16]. Also a company namedAppForge has made a development tool called CrossFire that makes possible to write.NET applications to Symbian [34]. However, major part of the application developmentin Symbian world is concentrated to C++ and Java.3.2.2 Multimedia Framework (MMF) The Multimedia Framework (MMF) in Symbian OS v.7.0s was totally new comparedto old versions. This framework is lightweight and provides multi-threaded environmentfor handling different kind of multimedia data. As today’s phones need a lot ofmultimedia capabilities MMF was made to support audio and video playback, streamingand recording. It also includes Image Conversion Library (ICL) that supports the mostbasic image types and more types can be added later through the third party plug-ins[29]. Architecture of MMF is illustrated in figure 3 [29].Figure 3: Architecture of MMF in Symbian OS v7.0s 7
  9. 9. As from the figure 3’s ICL can be seen, the framework has been made so that thirdparties can add supports to new file types later and therefore the framework is veryextensible. To support the plug-in architecture there are different kinds of abstract andconcrete classes that would help to create new plug-ins to support new media types. Inhere one can see the nature of Symbian as it is made to support the standards and issuppose to be an open environment for everyone. The framework nature also makespossible a concurrent processing of multiple multimedia data streams [29]. Lowest level in the framework is Media Support Library that at the moment onlysupports audio through the DevSound. This level only supports streaming and somecoded media formats that need hardware accelerator [32]. DevSound API offers widerange of different playbacks due to historical reasons as it can play tones for example. In the next level there are different plug-ins for midi, audio, video, speechrecognition and camera. The plug-in for camera only makes available a small API to useonboard camera so the basic camera functions can be used. Midi client is just astraightforward API to support playback and Midi events. The difference between audioand video is that the Symbian provides an audio engine that support some of the audiotypes historical used in phone industry (WAV, AU, AIFF, PCM, A-Law, u-Law, GSM6.10 etc), for the other types like MP3 and AAC there is an interface for third partyengines, for the video support there is no engine supported by Symbian so it iscompletely dependent on RealOne’s, PV’s or some other vendors engine [32].3.2.3 Future: Symbian OS v8.0 Symbian has released two new versions of its operating system that are 8.0 and 8.1.Nokia’s new 6630 phones have the 8.0 version but no other phones are shipping out yet.The difference between these two versions is not in the multimedia side, so the focus isin 8.0 in this paper. The key updates in 8.0 are hard realtime capabilities in kernel, major upgrade in Javato support for example 3D, OpenGL support and addition of Media Device Framework(MDF), which provides Hardware Abstraction Layer for multimedia hardwareacceleration. Also some other enchantments have been made [30]. The improvements in kernel have been made so the performance of the Symbian OSis improved and the manufacturers can use “single core” processors that integratetelephony and application processing. With this improvement the manufacturing costsof the phones can be reduced [30]. In Java side there are made a lot of improvements. New version of CLDC 1.1 andsome JSRs that include for example Mobile Media and 3D graphics are provided, so thefunctionality of Java is increased a lot. At the same time that the capabilities of Java areimproved it is also made possible to scale applications, better than before, to differentdevices as the performance of the mobile phones can vary a lot [30]. 3D support for mobile gaming and multimedia is also offered by offering OpenGLES API support. This probably is especially interesting for game manufacturers as this 8
  10. 10. improves a lot the graphical capabilities of mobile phones. The Media Device Framework offers an abstraction layer for hardware somanufacturers can easily take advantages of the new hardware technologies withoutfearing that the investments made in software is lost. This framework offers support forvideo, audio and voice recognition, so it is seen as a major improvement in the industryby accelerating the time to market for new devices [22].4 COMPARISONS, PROGRAMMING EXAMPLES4.1 Audio4.1.1 Microsoft Smartphone: Playing and Recording Sounds There are two different ways of playing waveform sounds in applications designedfor Windows CE based Smartphones. One is to use PlaySound-function [33] whichprovides basic and simple way for playing sounds. The other is to exploit the WaveformAudio API interface [21], which gives an exact control over possible audio I/O devices.It allows both playback and recording of sounds. The following code examplesdemonstrate the use of PlaySound-function:// plays the sound-file “sound.wav” stored in device’s memory:PlaySound (TEXT("SOUND.WAV"), NULL, SND_SYNC);// plays the sound which is associated with the event “ButtonClick” in// system registry:PlaySound (TEXT("ButtonClick"), NULL, SND_SYNC); Waveform Audio Interface provides another way to play sounds. It gives an extensivecontrol over the audio devices available, but is to a certain extent more complex to usethan PlaySound. Waveform Audio Interface uses Platform Invoke (P/Invoke)mechanism [21] to access the sound playing features provided by Windows CE, notavailable directly through .NET Compact Framework. The process of playing orrecording a sound with Waveform Audio Interface can be divided into separate stages.First step is to determine which audio I/O devices are available at the current system.After that a waveform device for playback or recording must be opened. Before the filecan be played or sound recorded, memory must be allocated for audio data blocks. Afterthat the playback or recording can begin. The following simplified example demonstratethe use of Waveform Audio Interface:// Wave file is played using the WaveOut-class, which provides a// simple interface for playing audio-files:WaveOut wo = new WaveOut();// File is played using the Play-method. Parameters are: file name to// be played, audio buffer size, volume for the left/right channel:wo.Play(fileName, 512*1024, 0xffff, 0xffff); 9
  11. 11. // Recording of a sound is done using the WaveIn-class, which is// similar to the WaveOut:WaveIn wi = new WaveIn();// Before the recording can begin, the Preload function must be called// to initialize the buffers and sound system. Parameters are: maximum// recording length (ms), buffer size:wi.Preload(3000, 256*1024);// The recording is started using Start method and stopped/saved using// the Save method:wi.Start();wi.Save(fileName);4.1.2 Symbian OS v.7.0: Playing and Recording Sounds Symbian offers a various ways to play different types of audio even without third-party plugins. WAV-files can be easily played with C++ application as the operatingsystem does most of the work. However, the more interesting part for Symbian is theJava support so here it is shown how an audio file is played using the Mobile MediaAPI. [35] import javax.microedition.media.*; import javax.microedition.media.control.*; import java.io.*; public class AudioPlayer implements Runnable { private MIDletController controller; private Player player; private VolumeControl volumeControl; private String url; // This makes reference to controller so AudioPlayer can // make call backs public AudioPlayer(MIDletController controller) { this.controller = controller; } // This initialization puts the player to separate thread public void initializeAudio(String url) { this.url = url; Thread initializer = new Thread(this); initializer.start(); } // In the run method the actual moving of the player through 10
  12. 12. // its states is done. First a player is created to with a// source url. Then additional initializations are done// including setting the volume and finally the player is// startedpublic void run(){ try { player = Manager.createPlayer(url); controller.updateProgressGauge(); player.addPlayerListener(controller); player.realize(); controller.updateProgressGauge(); player.prefetch(); controller.updateProgressGauge(); volumeControl = (VolumeControl)player.getControl("VolumeControl"); volumeControl.setLevel(50); controller.updateProgressGauge(); player.start(); } catch (IOException ioe) { controller.showAlert("Unable to connect to resource" , ioe.getMessage()); } catch (MediaException me) { controller.showAlert("Unable to create media player" , me.getMessage()); }}// This is for a restart of the player if neededpublic void replay(){ try{ player.start(); } catch (MediaException me) { controller.showAlert("MediaException thrown", me.getMessage()); }}// This is for setting the volume rightpublic void setVolume(int level){ volumeControl.setLevel(level);}// This is for closing the player 11
  13. 13. public void close() { player.close(); controller = null; url = null; } } MIDP also offers a way for capturing audio from an onboard hardware. The record ofa media is from any input and the media playback does not necessary have to besupported. Here is a short fragment of a code that records five seconds from audiodevice. [35] try { // Create a Player that captures live audio. Player player = Manager.createPlayer("capture://audio"); player.realize(); // Here a recordcontrol is obtained from the player and used // for to record audio from device RecordControl rc = (RecordControl)player.getControl(“RecordControl”); ByteArrayOutputStream output = new ByteArrayOutputStream(); rc.setRecordStream(output); player.prefetch(); // this will start recording if the player has started already // otherwise it waits for the player to start rc.startRecord(); player.start(); Thread.currentThread().sleep(5000); rc.commit(); player.close(); } catch (IOException ioe) { } catch (MediaException me) { } catch (InterruptedException ie) { }4.2 Video4.2.1 Video playback in Microsoft Smartphone Windows Mobile supports video playback in Smartphone devices through theWindows Media Player (WMP) [35]. It supports video formats, which are encodedusing Windows Media format (.wmv) or Advanced System Format (.asf). The latter is aspecification, which allows video content, compressed with a wide variety of different 12
  14. 14. codecs, to be stored in ASF-file and played back in WMP [14]. Playback of AVI and MPEG-1 video files is not supported in WMP of MicrosoftSmartphones. There is however some third-party video player applications, which canbe installed in Smartphone. PocketTV [21] is a movie player for PocketPC andSmartphone devices, which enables the playback of MPEG-1 video. DVD-to-Smartphone [6] is software, which can be used to watch DVD-movies in Smartphone. Itconverts and compresses the DVD-video to MPEG-4 format, allowing the data oforiginal video to fit in small capacity memory cards used in Smartphones.4.2.2 Video playback in Symbian OS v.7.0 As mentioned earlier Symbian, does not support native video playback. There arestill third-party plugins for example RealOne’s player, Packet Videos pvPlayer and anopen-source project Helix. These players support variety of media types for examplerealvideo, MPEG-4, H.263 etc. There is also a SmartMovie video player and converterwhere one can convert the video in computer and then watch it in Symbian phone. Thisplayer uses Xvid codec and the converter uses DirectShow codecs so one can downloadany codec from Internet to create a video for Symbian. [23] It is also possible to make a MIDlet as in audio part that creates a video player byusing the Mobile Media API. However, the 7.0s version includes only a subset ofMobile Media API and that does only support audio playback, volume control and tonegenerator [35]. The version 8.0 however includes the full support for Mobile MediaAPI.4.3 Graphics4.3.1 Graphics in Microsoft Smartphone .NET Compact Framework’s graphics-related features are constrained compared tothose in full .NET Framework. Although .NET Compact Framework supports basicdrawing primitives and their fill methods (i.e. ellipse, line, image, polygon, rectangle,string, and region) [36], more complicated methods for drawing, filling andtransforming, as well as 3d are not supported. .NET Compact Framework is able tocreate transparency using the color key, but neither alpha blending nor pixel-by-pixelblending of source and background colors is supported. Smartphone’s game API (GAPI) [31] enables direct access to device’s display andvideo frame buffer memory, which provides a way to create faster animated graphics(see section 4.4.1). Although it is originally designed for games development, it isequally useful in applications, which require fast graphics and ability to use the entiredisplay area.4.3.2 Graphics in Symbian OS v.7.0s Symbian uses shared heap to share applications access to screen, keyboard, pointingdevices, scalable fonts, and bitmaps. Also a generic framework, the Graphics DeviceInterface (GDI), is provided for drawing to any graphics device. It can be also used todrawing to windows, bitmaps or printers [29]. 13
  15. 15. For mobile phones the readability of the text is very important, as many times thesize of the display is small, in Symbian this problem is solved by supporting anti-aliasing for all text types. As there is no 3D support in version 7.0s the 2D graphics hasstill a hardware accelerator support in HAL (Hardware Abstract Layer). This featuresupports for example following operations: rectangle fill, polygon drawing and rectangleinvert [29]. Prior to Symbian 7.0 there was not a direct screen access implemented to Symbian. Inthe version 7.0 this enchantment was made so no tricks are needed anymore to bypassthe window server. Symbian has two ways for easy direct screen access.CdirectScreenAccess is a classic way, which hides the complexity and gives structuredcallbacks. Another way is to use RdirectScreenAccess that is not an active object sodeveloper has to develop a way to handle asynchronous nature of the Window serverthat CdirectScreenAccess does automatically [28].4.4 Games4.4.1 Smartphone Game Programming Microsoft Smartphone’s game API (GAPI) [37] provides functions to be usedespecially in games programming. It can also be exploited in applications where thewhole display area is needed or in applications, which need the exact control over thedevice’s hardware keys. GAPI addresses the need for fast graphics by allowing directaccess to the display’s video frame buffer memory. It hides the operating system’s menubar and thus allows the whole display to be used for game application. For controllingthe game, GAPI allows applications to take control of the hardware keys. SmartphoneAPIs can also be used to add effects, such as flashing display’s backlight and vibratingthe device. The following code example shows how the most common GAPI functions are usedin game application. Comments explain the purpose of each function:// Device’s display can be set to full screen mode by using the// GXOpenDisplay function. The same function ensures exclusive access// to the video frame buffer. When the GX_FULLSCREEN parameter is// used, hWnd is a handle to full screen mode:GXOpenDisplay(hWnd, GX_FULLSCREEN);// Device’s display-properties can be accessed using the// GXGetDisplayProperties-function, which returns a structure with// detailed information about the display hardware:GXDisplayProperties gx_displayprop;gx_displayprop = GXGetDisplayProperties();// Button-handling can be taken over by using GXOpenInput-function.// All hardware button presses generate appropriate messages to the// application instead of being sent to shell:GXOpenInput(); 14
  16. 16. // Most suitable control layout for a game can be switched on// using the GXGetDefaultKeys-function, which returns a list of// virtual key codes. For example, the virtual key “vKA” is a key// code of the best key to use for “shoot” or “jump” button in a game.// Parameters define the orientation of the device;// GX_NORMALKEYS corresponds to portrait orientation, GX_LANDSKAPEKEYS// to landscape orientationGXKeyList gx_keylist;gx_keylist = GXGetDefaultKeys(GX_NORMALKEYS);// The GXBeginDraw function prepares the display for drawing. It// returns a pointer to the start of display memory:unsigned short *buffer = (unsigned short*)GXBeginDraw();// GAPI operations can be suspended and resumed using GXSuspend and// GXResume functions respectively:GXSuspend();GXResume();// The drawing can be finished and resources released using the// following functions:GXEndDraw();GXCloseInput();GXCloseDisplay();4.4.2 Symbian OS v.7.0 game programming For Symbian the release of version 7.0s was a major when thinking about the supportto gaming. MIDP 2.0 and MMF offer a various ways to make games for any Symbianphone. Even a pure handheld console Nokia N-Gage is based on Symbian architecture.However the operating system in that is the older version 6.1. As Symbian does not offer any API just for game developing the Java support is bigboost for game developing. There are a lot of games even today that can be easily portedto Symbian, thanks to its Java capabilities. As Symbian’s native language is C++ there are many games developed in thatenvironment too. Especially as the C++ code is more efficient, as its native to Symbian,there is also a lot of development done in that side. Of course the trouble in that, is thatthere is no common user interface, but at the moment Nokia’s Series 60 has gainedpopularity, so this is a possible solution for the problem. The following code is an example from a bouncing ball application. In this short codewe do the following things: [28] - clean up the previous position of our ball on screen - update the position of the ball - copy the image of the ball to the new position - flush the screen buffer 15
  17. 17. - reset the timer void CDDBouncingBallEngine::RunL() { // Force screen update: this required for WINS, but may // not be for all hardware iDirectScreenAccess->ScreenDevice()->Update(); TRect sourceRect(iPosition,iBallImage->SizeInPixels()); iGc->Clear(sourceRect); // Update the balls position MoveBall(); // and draw ball iGc->BitBlt(iPosition, iBallImage); iClient.Flush(); // Renew request After(TTimeIntervalMicroSeconds32(KGenerationInterval)); }5 SUMMARY There is a big difference in the way of thinking between the Symbian and Microsoftworld. As the Symbian is very modular and support wide variety of plugins and evenpromotes the third parties to do these, Microsoft wants to keep as much as possible totheir own. Of course, this is partly due also to their different ownership. As theMicrosoft is a normal limited company the Symbian is a joint-company of six bigmobile phone companies. Both sides of these have their pros and cons. With open standards the Symbian luresthe open source community and small businesses to develop a lot of differentapplications. In the other hand, Microsoft way of protecting its own software also makesapplication developers safer as they have to follow just one company, not many smallerones. The other big difference comes from the developing environment. Microsoftpromotes its own .NET architecture also in the mobile side as the Symbian tries to getall the best from the Java world, by following the latest standards in that. Symbian alsohas other developing environments, but these are not promoted as much as the Java. Onecould even say, that Symbian is trying to get the lead with so fashionable J2EE, J2MEand other Java speak. As a minor notice the open standards idea of Symbian can be seenfrom the Appforges Crossfire application that will bring .NET developing to Symbian. The support for audio is in decent level already in mobile phones. Both systems haveways to play different audio files and complete control through APIs to audio devicesonboard. In a future there will not probably be any big differences in this side, as most 16
  18. 18. of the limitations are due the mass memory and headphones that are not the issues ofoperating system. In the graphics side the battle is just going to begin. As in the past there have notreally been 3D graphics, but for the future versions it is coming. Symbian already has afull steam promoting its OpenGL support in the 8.0 versions and Microsoft is probablyvery close too especially in its Windows CE 5.0 operating system. For consumers it isinteresting to see, do we get the same kind competition as in the PC market where thedifference is made in the hardware. The safer bet for direction is the way gamingconsoles are coming. For few years there is always some kind of standard before theevolution takes a leap. Video has been said to be the killer application in 3G mobile phoning. It is not yetreclaimed its promises as the display side and the size of the video file has been too bigfor video. From today’s phones this can be seen also, as neither of the systems offernative support for example MPEG-video. This support is however supported throughthird party applications and for the both there is also a way to convert DVDs to mobilephones This can be seen mainly just a geek playing with the latest technology, but sure itis some kind of mark for what is coming. In gaming there is one big difference. Symbian doesn’t offer anything just for thegame developing, even though it is promoting all kind of development in that side. Inthe contrast Microsoft is offering an API just for games in Smartphone. Symbian is stillnot weaponless in this issue as its offers Java support that makes available a lot offeatures that support game development. It can be said, that both systems offer more common features especially inmultimedia side than differences. It can be seen, that Microsoft still believes its ownpower, but not as much as in the computer side. Of course, this is due the fact thatMicrosoft is the challenger with its Smartphone to the old mobile phone companies thattry to keep Microsoft away from the phone industry.REFERENCES[1] Advanced Systems Format (ASF) Specificationhttp://www.microsoft.com/windows/windowsmedia/format/asfspec.aspx[2] Appforgehttp://www.appforge.com/[3] Crooks, Clayton E. 2003. Developing Tablet PC applications. Charles River Media.pp 37-38[4] Developing Applications for Windows Mobile: FAQhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppcgen/html/devmobfaq.asp[5] Differences between the .NET Compact Framework and the full .NET Frameworkhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_evtuv/html/etcondifferenceswithnetframework.asp 17
  19. 19. [6] DVD-to-Smartphonehttp://www.smartphone.net/software_detail.asp?id=724[7] Hiipakka, J. 2004. Symbian OS 7.0S - Multimedia Frameworkhttp://www.tml.hut.fi/Opinnot/T-111.550/T-111.550-20041019-Symbian.pdf[8] How to Create a Microsoft .NET Compact Framework-based Image Buttonhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/ImageButton.asp[9] Jakl, A. The workflow of C++ game developmenthttp://www.symbian.com/developer/techlib/papers/workflowcppgame/WorkflowOfGameDevelopment.pdf[10] Joende, M. Working with the Mobile Media API – Part 1 and 2Part 1:http://www.symbian.com/developer/techlib/papers/Working_with_Mobile_Media_API.pdfPart 2:http://www.symbian.com/developer/techlib/papers/midptools/MobileMediapart2_v1.1.pdf[11] Microsoft .NET Compact Frameworkhttp://msdn.microsoft.com/smartclient/understanding/netcf/[12] Microsoft .NET Framework Developer Centerhttp://msdn.microsoft.com/netframework/[13] Microsoft .NET Framework Technology Overviewhttp://msdn.microsoft.com/netframework/technologyinfo/overview/default.aspx[14] Mobile and Embedded Application Developer Centerhttp://msdn.microsoft.com/mobility/windowsmobile/default.aspx[15] NewLC - The Symbian OS C++ Developer Communityhttp://www.newlc.com/[16] OPL-dev projecthttp://opl-dev.sourceforge.net/[17] Overview of the .NET Frameworkhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpovrintroductiontonetframeworksdk.asp[18] Overview of Windows Media 9 Serieshttp://www.microsoft.com/windows/windowsmedia/technologies/overview.aspx[19] PocketTV 18
  20. 20. http://www.pockettv.com/[20] Series60 platformhttp://www.series60.com/[21] Recording and Playing Sound with the Waveform Audio Interfacehttp://msdn.microsoft.com/mobility/samples/default.aspx?pull=/library/en-us/dnnetcomp/html/waveinout.asp#waveinout_topic_002[22] Similarities between the .NET Compact Framework and the full .NET Frameworkhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_evtuv/html/etconsimilaritieswithnetframework.asp[23] SmartMoviehttp://www.lonelycatgames.com/mobile/smartmovie/smartmovie.html[24] Sun: J2ME Mobile Information Device Profile (MIDP)http://java.sun.com/products/midp/[25] Sun: PersonalJavahttp://java.sun.com/products/personaljava/[26] Symbian OS - the mobile operating systemhttp://www.symbian.com/index.jsp[27] Symbian Developer Networkhttp://www.symbian.com/developer/index.html[28] Symbian: Implementing Direct Screen Accesshttp://www.symbian.com/developer/techlib/papers/dsa/direct_screen_access.pdf[29] Symbian OS Version 7.0s functional descriptionhttp://www.symbian.com/technology/symbos-v7s-det.htm[30] Symbian OS Version 8.0 functional descriptionhttp://www.symbian.com/technology/symbos-v8x-det.html[31] Technical Documentation for Windows Mobilehttp://msdn.microsoft.com/mobility/windowsmobile/howto/documentation/default.aspx[32] Mikkonen, T. 2004. Mobiiliohjelmointi. Gummerrus Kirjapaino Oy. pp. 13-15[33] Using the PlaySound Functionhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcewave/html/_wcesdk_using_the_playsound_function.asp[34] Windows CE Product Informationhttp://msdn.microsoft.com/mobility/othertech/windowsce/default.aspx 19
  21. 21. [35] Windows Media Overview and Optimization for Windows CE .NET 4.2http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncenet/html/conwindowsmediaoverviewoptimizationforwindowscenet42.asp[36] Windows Mobile-based Smartphoneshttp://www.microsoft.com/windowsmobile/smartphone/default.mspx[37] Windows Mobile-Based Smartphone API Referencehttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/apisp/html/sp__windowsmobile_api_reference.asp 20

×