How to: “embed” Flash Lite into C++ Symbian application

There are at least two valid reasons for embedding a Flash Player instance into a native c++ application: the possibility of having two or more instances of the player running at the same time and the presence of our personalized icon in the system task manager.

To achieve this our application have to handle an instance of the player using CDocumentHandler class and in particular OpenFileEmbeddedL mehotd:

Embedded launching means that the UI of an application, which is responsible for handling given data type, is embedded into the parent application. There will be only parent applications icon shown in the fast swap window when an application is embedded.

The only thing we must remember is that our native application have to handle exit event from the embedded player.

So, basically, our view have to be defined as an Observer for such type of event by implementing MAknServerAppExitObserver interface and by defining HandleServerAppExit method:

To launch our document handler we must do something like this:

By this way the default player for the specified mime type is embedded in our application view… pretty cool! If we want to call a specific player we must define the specific UID in our TDataType object (please refer to the SDK documentation for any doubt).

I’ve compiled and tested the code for Symbian 9.x, but it can be used also for previous symbian versions. I hope this can be helpful. All comments, suggestions and corrections are appreciated.

THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

Comments

comments

Leave a Reply

Your email address will not be published.


*