FleaC – A Smarter API for Symbian OS

Published by at

With ten years of experience in Symbian C++, the team at Fleasome believe they have a better way to create Symbian C++ applications with FleaC. FleaC offers a simplified API for many key Symbian C++ features and claims to improve developer productivity by up to fifty per cent.

The Fleasome development team have been working with Symbian – and Epoc before it – for some ten years. The company, based in Kuopio, Finland, has been offering development and training services for Symbian C++ since 2000. Amongst the company’s achievements is authorship of the first Finish language book on Symbian programming.

‘From our earliest days, working with Symbian, we thought it was a little bit too hard for beginners to start programming,’ says Pekka Niskanen, technology manager at Fleasome. ‘Even for experienced developers the development and maintenance of Symbian applications is quite time consuming. We always expected someone to do something about this. About three years ago it became clear that no one was going to address the problem, so we decided to do something about it.’

The result of this decision was FleaC.

While the goal was to create an easier to use API, Fleasome was not in a position to completely rewrite the Symbian C++ API, so needed to identify a set of APIs to which it could bring meaningful improvements. ‘Choosing the key components to address was not hard,’ says Pekka. ‘For example, you need descriptors in almost every Symbian application. Because descriptors are unique to Symbian they are also a real challenge for newbies. Then you have other basic components such as arrays, string lists, and files that get used in most applications. So choosing where to start was not difficult.”

The next most obvious set of APIs to address were those that are commonly used in mobile applications. Here communication features, such as internet connectivity and messaging, were high on the list for Pekka. ‘We simply relied on our experience to determine what are the most used APIs,’ says Pekka.

This work resulted in the first release of FleaC in October 2008 that provided APIs for strings, lists, date and time, HTTP, and SMS among others. Then in March this year version 2.0 added several more APIs for application oriented features such as phone calls, contacts, calendar, and location as well as additional communication features with support for Bluetooth and asynchronous HTTP.

One area FleaC does not address is the UI, a no less challenging aspect of Symbian C++ programming. ‘We have considered whether we can do anything with the UI,’ says Pekka. ‘The challenge for us is that the UI is very extensive, so encapsulating it is a big job. We are working on it, but it’s not yet ready.’

Creating an easier to use API is not only about making Symbian more accessible to new developers. ‘We have created FleaC to achieve real productivity gains for developers,’ says Pekka. ‘FleaC makes coding easier by reducing the number of lines of code that need to be written, but this also means that applications are easier to understand and therefore easier to maintain.’

There are some conceptual similarities between FleaC and Qt software – particularly now Forum Nokia has made the first preview of Mobile Extensions for Qt for S60 available. ‘The biggest difference between FleaC and Qt is that our solution is ready today. Also Qt is still a large API set with a steep learning curve for new developers. In addition, Qt does not directly integrate with existing Symbian C++ applications, while developers can get benefits from using FleaC in their existing code,’ says Pekka. ‘Ultimately, however, I feel that our solution could compliment Qt as it’s not a direct competitor.’

To understand how FleaC makes coding less complex take a look at the following code, which creates two strings and compares their content using FleaC:

FString myString = "Test String";
FString myString2 = "Test String";

// Compare strings
if (myString == myString2)
{
// Do something ...
}


To achieve the same in Symbian C++ would require fifteen lines of code that utilises three different classes, as follows:

const char* myString = "Test String";
TPtrC8 source( (TText8*) myString );
HBufC* buf = HBufC::NewL( source.Length() );
TPtr16 ptr = buf->Des();
ptr.Copy( source );

// Create string 2
const char* myString2 = "Test String";
TPtrC8 source2( (TText8*) myString2 );
HBufC* buf2 = HBufC::NewL( source2.Length() );
TPtr16 ptr2 = buf2->Des();
ptr2.Copy( source2 );

// Compare strings
if (ptr2.CompareC(ptr) == 0)
{
// Do something ...
}

// Clean up
delete buf;
delete buf2;


As the APIs become more complex the comparative advantages for FleaC become greater, according to Pekka who claims that for a typical application using SMS or HTTP FleaC can reduce the coding effort by up to fifty per cent.

FleaC is currently available for S60 3rd and 5th editions, but Pekka says that he has been approached to port the FleaC library to earlier S60 editions and UIQ. ‘We have been in touch with several developers who have custom UIQ 3 applications to support,’ says Pekka. ‘They have evaluated FleaC for S60 and want to get the same benefits for all their software.’

FleaC 2.0 is currently available as a free evaluation version for building applications for the S60 emulator. To compile applications for devices FleaC needs to be licensed. Licences are available on a per developer basis for €1,000 which includes one year’s online support and 1 day free training assistance.

The next step for FleaC is a cross platform version of the APIs. This will be for a Linux platform, but Pekka is not yet saying which one.