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.

About the author

Giorgio Natili Giorgio Natili is Adobe community expert, a W3C member and an agile practitioner. He is head of his own company GNStudio, which has been operating in the web development filed for the past 9 years. His field of expertise focus on Adobe Flash, Fireworks, Dreamweaver, Coldfusion Flash Media Server, Flex and their integration, as well as accessibility both in html and Flash.

More recently his interests have broadened to include developing mobile applications and e-learning tools. He strongly believes in the need to spread new web-technologies by ‘evangelizing’ in the Italian development communities.

If you enjoyed this article, you might also like...

Post comment

About MobileRevamp

The aim of this community is to share as much as possible information related to the mobile development using all the social networks and the new capabilities of the NET to make easier find updated contents and to create a deep feeling of connection between developers.

Photostream

IMG_0276IMG_0275IMG_0274IMG_0273IMG_0272IMG_0271

Updates

    Archives

    Recent Comments

    Adobe Mobile UGs

    Authors