Problem: How to dynamically call other application in the flash? This function can be implemented with c++ as follows.
Question: Does flashlite provides an api like RApaLsSession.StartDocument()? If not, is there any other method to solve this problem?
Thanks!
void RunApp{
RApaLsSession apaLsSession;
const TUid KOSSBrowserUidValue = {0x20003ADB}; //App UID
HBufC* param = HBufC::NewLC(256); // Symbian string
param->Des().Zero();
param->Des().Copy(_L("-open e:\\preview\\VI_Fearless-qvga.smv")); //App argument
TUid id(KOSSBrowserUidValue);
TApaTaskList taskList(CEikonEnv::Static()->WsSession());
TApaTask task = taskList.FindApp(id);
if(task.Exists()) //if App already run, bring it foregroud
{
task.BringToForeground();
HBufC8* param8 = HBufC8::NewLC(param->Length());
param8->Des().Append(*param);
task.SendMessage(TUid::Uid(0), *param8); // UID not used
CleanupStack::PopAndDestroy(param8);
}
else //if App not Run, start it
{
if(!apaLsSession.Handle())
{
User::LeaveIfError(apaLsSession.Connect());
}
TThreadId thread;
User::LeaveIfError(apaLsSession.StartDocument(*param, KOSSBrowserUidValue, thread));
apaLsSession.Close();
}
CleanupStack::PopAndDestroy(param); //clean up CleanupStack
}







