Categories: Code Examples | Symbian C++ | Flash Lite | UI | How To
This page was last modified 09:54, 8 December 2007.
How to make Flash launcher with Symbian C++
From Forum Nokia Wiki
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(); }
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Embedded Flash Lite & Key events & problem with red button | EagleSW | Flash Lite on Nokia Devices | 3 | 2008-01-11 18:53 |
| can s40 sdk 3ed edtion play flash? | lizhongrui | Mobile Java Tools & SDKs | 5 | 2006-07-04 17:48 |
| Creating flash content for MMS | twiggit | General Messaging | 1 | 2002-11-27 05:09 |
| Flash Lite 2.0 or 2.1 in S60? | 2olivia | Flash Lite on Nokia Devices | 2 | 2007-10-07 18:19 |
| Is there any tools can compile macromedia flash projects to symbian applications ? | far_yous | Mobile Java Media (Graphics & Sounds) | 1 | 2006-01-25 18:49 |
