Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Cross platform comparison

tompaana edited this page Nov 12, 2014 · 2 revisions

Drumkit application on three different mobile phone platforms

The Drumkit application was originally created for Series 40. Later it was also implemented for Windows Phone 7, Symbian, and MeeGo 1.2 Harmattan.

The devices running WP7, Series 40, Symbian, and MeeGo 1.2 Harmattan have different screen resolutions. The Series 40 version of the application has been targeted specifically for a 240 x 320 pixels portrait resolution. Other versions have been locked to the landscape resolution. So the WP7 version has been fixed for 800x480 resolution, MeeGo 1.2 Harmattan for 854 x 480, and Symbian for 640 x 360 and 640 x 480 (the Nokia E6). In the Drumkit application this means that the graphics assets cannot be shared and need to be redrawn for each target resolution.

The sound samples are compatible between WP7 and Series 40. On Qt the sample format is different because Qt !GameEnabler is used, and this requires a another sample format. The underlying platform is not a limiting factor here.

From the programming perspective these platforms are quite different compared to each other, and therefore the actual code cannot be shared.

WP7

WP7 offers two choices for application development:

  • Silverlight is a framework for building rich interactive applications.
  • XNA is an environment aimed for game development.

The programming language is mainly C#. In SilverLight the UI can be also created with XAML, which is an XML-based declarative language.

XNA was chosen for the Drumkit because good performance was required. The user interface is custom made using techniques available in XNA. The XNA Audio library is used for sample playback.

WP7 devices have plenty of memory, CPU, and graphics power.

Series 40

On Series 40, the programming language is Java, and the platform is Java ME which is a Java platform meant for mobile devices.

Java ME offers a library called LCDUI for creating graphical user interfaces. It also offers the Game API, an extension of LCDUI, which provides classes that enable developing gaming content.

In Drumkit, the custom user interface is based on !GameCanvas from the Game API. Standard UI components have not been used.

Sample playing is done with the Mobile Media API, a Java ME specific library, which offers very good audio latency. While you can install and run the application also on Symbian, it has not been optimised for Symbian screen sizes. Also the audio latency is way too big for this kind of an application.

Series 40 devices do not have a lot of resources available. Using graphic and sound files must be considered carefully. Processor and graphics power is limited so large animations and effects may not be possible.

Symbian and MeeGo 1.2 Harmattan

On Symbian and MeeGo 1.2 Harmattan the programming languages are QML and C++. The framework used is Qt. The user interface has been created with QML (Qt Quick). The Qt framework allows cross-platform development so the code will work with minor modifications on both Symbian and MeeGo 1.2 Harmattan.

The user interface is a custom UI like on the other platforms. The engine and playback portions have been implemented with Qt C++.

There are several options for sample playing. In addition to cross-platform QML and Qt C++ APIs, there are platform APIs for both Symbian and MeeGo 1.2 Harmattan which provide more configuration options. Native Symbian and MeeGo 1.2 Harmattan audio APIs have been used in this application to achieve lowest possible latency in audio output.

Like the WP7 devices, Symbian and Nokia N9 devices are powerful. Effects and animations can be safely used.

Touch events

Java ME and Qt applications receive UI events to callbacks, which then perform accordingly. QML does not currently support raw touch events so a lower level solution is needed: Qt touch support is used and these events are passed to QML.

In XNA touch events are polled in the game loop, which causes quantization. So with an update rate of 30 fps there will be approximately a 33 ms increase to the touch-to-audio latency in maximum. However, the Mango update allows increasing the frame rate to up to 60 fps.

Silverlight would also let us use callbacks for more immediate touch events. However, at the time developing the WP7 version Silverlight was suffering from inconsistency of touch events, which affected the framework choice. The Mango release seems to have fixed also this problem.

Audio latency

Below is some data concerning the audio latency of Drumkit on these platforms. The latency was measured with a simple microphone setup by determining the time between the screen tap and the consequent sample playback from the wave form.

Device/platform Average latency (ms) Standard Deviation (ms)
Nokia N8 Symbian Anna 133.8 8.4
Nokia N9 Harmattan 62.2 3.9
Nokia Lumia 800 Windows Phone 7.5 XNA 45.7 8.4
Nokia X3-02 Series 40 44.6 10.5

Symbian is not really a suitable platform for this kind of application, whereas MeeGo 1.2 Harmattan seems to do a pretty decent job. Windows Phone and Series 40 offer actually quite good latency. Musicians would consider the 40 ms delay still too long, but for a mobile platform it is already a pretty good touch-to-audio latency. Interestingly, quick testing on the Nokia Lumia 800 and Silverlight reveals a very promising latency of only 34.7 milliseconds with an amazing 1.3 ms standard deviation.