Namespaces
Variants
Actions

How to make Flash launcher with Symbian C++

Jump to: navigation, search
Article Metadata

Article
Created: symbianyucca (19 Mar 2007)
Last edited: hamishwillee (11 Jan 2012)

To have an icon in normal menu you need to make a Symbian application and you need to define the normal application framework etc. These you can do with the application wizard. How to change the application icon is shown in How to define application icon. Then just add the codes to the application user interface class.

Contents

Symbian S60 3rd Edition devices

With S60 3rd Edition you can use RFile with Document handler as follows (shown also in Run_Flash.cpp file):

iHandler = CDocumentHandler::NewL( NULL );
iHandler->SetExitObserver(this);
 
TFindFile AufFolder(CCoeEnv::Static()->FsSession());
if(KErrNone == AufFolder.FindByDir(KTxtFlashFileName, KNullDesC))
{
RFile Runfile;
User::LeaveIfError(Runfile.Open(CCoeEnv::Static()->FsSession(), aFlashAppName, EFileShareReadersOnly));
CleanupClosePushL(Runfile);
 
TDataType Dummy;
 
User::LeaveIfError(iHandler->OpenFileEmbeddedL(Runfile, Dummy));
 
CleanupStack::PopAndDestroy(); // sharedfile
}

Note that you also need to implement the MAknServerAppExitObserver in your Application user interface class.

Symbian S60 3rd Edition FP1 devices

... dedicated API ...

Symbian S60 Pre-3rd Edition devices

With 2nd Edition you can utilize the RApaLsSession directly as follows (shown also in Run_Flash2.cpp file):

RApaLsSession session;
session.Connect();
CleanupClosePushL(session);
 
TFindFile AppFile(CCoeEnv::Static()->FsSession());
if(KErrNone == AppFile.FindByDir(KTxtFlashFileName, KNullDesC))
{
TThreadId id;
User::LeaveIfError(session.StartDocument(AppFile.File(), id));
}
 
CleanupStack::PopAndDestroy();//session.Close();


Run_Flash2.cpp

#include <apgcli.h>
 
_LIT(KTxtFlashFileName, ":\\others\\MyFlashFile.swf" );
//_LIT(KTxtFlashFileName, ":\\private\\<My-SID>\\MyFlashFile.swf" );
 
 
void CFlashStubAppUi::ConstructL()
{
BaseConstructL(CAknAppUi::EAknEnableSkin);
 
RApaLsSession session;
session.Connect();
CleanupClosePushL(session);
 
TFindFile AppFile(CCoeEnv::Static()->FsSession());
if(KErrNone == AppFile.FindByDir(KTxtFlashFileName, KNullDesC))
{
TThreadId id;
User::LeaveIfError(session.StartDocument(AppFile.File(), id));
}
 
CleanupStack::PopAndDestroy();//session.Close();
 
User::Exit(0);
}
 
CFlashStubAppUi::CFlashStubAppUi()
{
// No implementation required
}
 
CFlashStubAppUi::~CFlashStubAppUi()
{
 
}
 
void CFlashStubAppUi::HandleCommandL( TInt aCommand )
{
switch( aCommand )
{
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
break;
default:
break;
}
}


Run_Flash.cpp

#include <documenthandler.h>
#include <apgcli.h>
 
_LIT(KTxtFlashFileName, ":\\others\\MyFlashFile.swf" );
//_LIT(KTxtFlashFileName, ":\\private\\<My-SID>\\MyFlashFile.swf" );
 
void CFlashStubAppUi::ConstructL()
{
BaseConstructL(CAknAppUi::EAknEnableSkin);
 
iHandler = CDocumentHandler::NewL( NULL );
iHandler->SetExitObserver(this);
 
TFindFile AufFolder(CCoeEnv::Static()->FsSession());
if(KErrNone == AufFolder.FindByDir(KTxtFlashFileName, KNullDesC))
{
RFile Runfile;
User::LeaveIfError(Runfile.Open(CCoeEnv::Static()->FsSession(), aFlashAppName, EFileShareReadersOnly));
CleanupClosePushL(Runfile);
 
TDataType Dummy;
 
User::LeaveIfError(iHandler->OpenFileEmbeddedL(Runfile, Dummy));
 
CleanupStack::PopAndDestroy(); // sharedfile
}
}
 
CFlashStubAppUi::CFlashStubAppUi()
{
// No implementation required
}
 
CFlashStubAppUi::~CFlashStubAppUi()
{
delete iHandler;
}
 
void CFlashStubAppUi::HandleCommandL( TInt aCommand )
{
switch( aCommand )
{
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
break;
default:
break;
}
}
 
void CFlashStubAppUi::HandleServerAppExit (TInt /* aReason */)
{
Exit();
}

Comments

Reviewer-approved.png
19 Sep
2009
Article Review by deepikagohil (20090919)

Good article on creating a launcher application for FlashLite applications.

The article is recommended to follow to create a launcher application. Even though currently adobe has made it available to create the mobile packager, it supports on only certain pltform eg S60 and Window mobile.


This page was last modified on 11 January 2012, at 06:31.
97 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2012 All rights reserved