TApaTaskList taskList(
CEikonEnv::Static()->WsSession() );
TApaTask task = taskList.FindApp( id );
if ( task.Exists() )
{
HBufC8* param8 = HBufC8::NewLC( param->Length() );
param8->Des().Append( *param );
task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used
CleanupStack::PopAndDestroy(); // param8
}
else
{
RApaLsSession appArcSession;
User::LeaveIfError(appArcSession.Connect()); // connect to AppArc server
TThreadId id;
appArcSession.StartDocument( *param, TUid::Uid( KWmlBrowserUid ), id );
appArcSession.Close();
}
CleanupStack::PopAndDestroy(); // param
}
//----------------------------------------------------------------------------
This works well. It connects using its Default Access Point defined in its Setting menu.
For some URLs I need to change Default Access Point defined in Wap Browser. At least, I need to ask user to select one.
Is this possible?
Using this code:
//----------------------------------------------------------------------------
CCommsDatabase* db = CCommsDatabase::NewL(EDatabaseTypeIAP);
CleanupStack::PushL(db);
db->SetGlobalSettingL( TPtrC(ASK_USER_BEFORE_DIAL), ETrue );
CleanupStack::PopAndDestroy(1);
//----------------------------------------------------------------------------
I can enable to prompt APN selection dialog. It will ask an APN but this does not effect Wap Browser.
With the following code, you will be able to close existing connections.
The pending problem is that you must discover the connection that is being used by the S60 Browser.
//Start or attach the RConnection to an interface on the server
TUint connectionCount;
//Enumerate currently active connections across all socket servers
err = myConnection.EnumerateConnections(connectionCount);
if(err != KErrNone) return err;
if(connectionCount == 0) // if no connections are started
{
VDebug::singleton()->dataFormat(VLIT("S60IPManager::startConnection(): connectionCount == 0"));
}
else
{
TPckgBuf<TConnectionInfoV2> connectionInfo;
err = myConnection.GetConnectionInfo(1, connectionInfo); // 1 = first active connection