Search:
|
Access:
» ECOM: plugins for Symbian OSRelated categories: Unix | Programming in generall Rafa³ KociszViewed: 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 authorRafa³ 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. QuickstartTo run the sample application for this article in an emulator, do the following:
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 frameworkMost 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:
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 applicationTo 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
|
|
Copyright C 2006 by Software Developer's Journal. All rights reserved.






SDJ Users:
Shopping Cart









