Access:

» ECOM: plugins for Symbian OS

Related categories: Unix | Programming in generall

Rafa³ Kocisz
Viewed: 6994 | Article date: 2006-05-11 15:15:06

This article presents an introduction to ECOM - the plugin framework for the Symbian operating system. From my own professional experience I know that Symbian plugins can be extremely useful, but the first contact with the ECOM framework can be somewhat overwhelming, especially if you're just getting to know Symbian itself.

This article presents an introduction to ECOM - the plugin framework for the Symbian operating system. From my own professional experience I know that Symbian plugins can be extremely useful, but the first contact with the ECOM framework can be somewhat overwhelming, especially if you're just getting to know Symbian itself.

About the author

Rafa³ Kocisz works at BLStream (www.blstream.com) as computer systems architect and senior programmer. His professional interests revolve around mobile technologies, especially the Symbian platform. He is also a doctoral student at the Computer Science department of the Szczecin Technical University, where he conducts research into parallel and distributed processing.

Contact with the author: rafal.kocisz@blstream.pl, rkocisz@wi.ps.pl

My aim in writing this article was to provide a clear and simple yet detailed introduction to ECOM, and to this end I've put together a simple (though non-trivial) application demonstrating the mechanisms discussed. The sample program provides the basis for a step-by-step tutorial on creating an ECOM plugin. The source code and architecture of the application are carefully designed and thoroughly tested, so they can be used to build both training programs and production-quality applications.

Before we begin...

Developing software for the Symbian OS is a fairly complex and challenging task, especially for beginners. There are several reasons for this, starting with the necessity of working in an emulated development environment. An additional problem is the relative scarcity of good literature on Symbian development. Not that I'm trying to discourage you. Far from it - in writing this article, I wanted to show that even such complex issues as plugin development can be mastered quite easily, of course provided you have the necessary background knowledge. The article is not intended as a starting point for Symbian programming, so if you're completely unfamiliar with the platform I suggest you catch up on the basics first. A good place to start would be the Symbian workshop in the May 2005 issue of SDJ, as it provides a friendly and concise introduction to the essentials of Symbian development.

Quickstart

To run the sample application for this article in an emulator, do the following:

  • install ActivePerl,

  • install the Symbian Series 60 SDK,

  • copy the project directory to your hard disk (use the same partition you installed the SDK to),

  • enter the build subdirectory in the project hierarchy,

  • run the following commands:

    • bldmake bldfiles

    • abld build wins udeb

    • abld freeze

    • abld build wins udeb

  • start the emulator (for example from the Start menu),

  • the IFTool icon should be visible at the end of the application list (you can scroll it using the arrow keys).

NOTE: The instructions assume you are running Windows with MS Visual C++ installed.

The approach I've adopted for this article is that information not directly related to ECOM, but useful for understanding the big picture, can be found in Frames throughout the article. Hopefully this will make the key concepts easier to understand for everyone less familiar with Symbian while keeping the workshop focussed. It's also worth having a look at the web resources listed towards the end of the article, and anyone intent on seriously getting into Symbian development would do well to get their hands on the books listed in the Frame Further reading. If you have any questions concerning the article, feel free to contact me.

Plugin framework

Most software users are intuitively familiar with the concept of plugins as dynamically added extensions to core application functionality. Many popular programs - most notably media players - support plugins that extend their basic capabilities (for example adding support for new file formats without reinstalling the whole application) or modify the application on the fly without interfering with the source code (for example changing the user interface using skins). More advanced plugins can be found in modern web browsers, such as Firefox or Opera.

More formally, a plugin could be defined as a self-contained piece of executable code that can be dynamically linked into an existing application to modify or extend its functionality. Of course, a plugin is not much use without application code to support it. From a programmer's point of view, the key concept here is that of a plugin framework to provide this functionality. The framework should:

  • define an interface for plugins;

  • support one or more implementations of the plugin interface (i.e. actual plugins) that will only be loaded at runtime;

  • provide the client with a plugin management capability, covering such actions as loading, destroying and distinguishing plugins.

Once such a framework is ready, adding and supporting plugins is easy. Now for the good news: in Symbian OS, a plugin framework is integrated into the system, just waiting to be used. Let's see how it's done.

Creating the IFTool application

To make this ECOM tutorial easier and more engaging, I've decided to prepare a relatively simple yet non-trivial and genuinely useful project to illustrate the stages involved in working with Symbian plugins. The source code is freely available and you are encouraged to experiment with the application and extend its basic functionality.

The program is called IFTool, which is short for Image Filtering Tool. IFTool is a simple graphics manipulation utility that can load an image file (typically from permanent storage), perform basic transformations on the image (i.e. filter it) and write the modified file back to storage. What for? - I hear you ask. Well, if you've ever taken photos using a mobile phone camera you will know they are usually of rather poor quality, especially in low light conditions. However, running such a photo through some elementary filters (even just a basic averaging filter) can significantly improve the quality, so having a simple graphics utility on your phone makes it possible to quickly send the improved photo to your friends by MMS or upload it to your blog.

For the purpose of this article, the most important feature of IFTool is that each filter is implemented as a plugin, so both the author and potential users of the program have the option of easily adding more filters in the future. The basic version presented in the article will offer two ECOM-based filters. Adding other filters is left as an exercise for the reader, as suggested later in the article.

The sample application was developed for the Series 60 platform with Symbian 7.0 or later, but as ECOM is an integral part of the core Symbian system, the same techniques can be used when developing software for other Symbian-based platforms, such as UIQ.

Figure 1 presents sample screenshots of the finished application, while the Frame Quickstart presents the steps necessary to build and run the program.

Figure 1. Screenshots of the IFTool program

Page: 1 2 3 4 5 6
Buy article Buy subscription
Buy now add to cart
add to cart
Standard price: 2€/$3 Standard price: 25€/$30
Buy article for as little as (2€/$3) each allow access to individual articles. Buy a full access to our Software Developers's Journal archive portal. You will be able to read the articles from all archive issues from year 2005 and 2006. For just 25€/$30 you get unrestricted access to the entire website for the whole year.
SDJhakin9

.SDJ Users:


.:Login
.:Password

[Register]
[Forgotten your password?]

...Shopping Cart

sum: 0 €
Choose currency:

...Topics

...Advertisement

www.acunetix.com www.verifysoft.com

...Conferences




...Print Edition Archive

...Affiliate Program



 

 

Subscribe | Contact Us | Newsletter | Privacy policy | Regulations | See all issues | About SDJ
Copyright C 2006 by Software Developer's Journal. All rights reserved.