×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    1

    Problem in launching web browser in S60 3rd Edition

    I wanted to launch a web browser with a page opened by default. The application works fine. But the url is openeing in a popup in the browser. So if I open the url more than 5 times it does not allow me to open it as the maximum no of opened popup is 5 in my Nokia E71.
    I used the following code
    HBufC* param = HBufC::NewLC( 20 );
    param->Des().Copy( _L( "4 http://www.yahoo.com/" ) );
    const TInt KWmlBrowserUid = 0x10008D39;
    TUid id( TUid::Uid( KWmlBrowserUid ) );
    TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
    TApaTask task = taskList.FindApp( id );
    if ( task.Exists() )
    {
    task.BringToForeground();
    HBufC8* param8 = HBufC8::NewLC( param->Length() );
    param8->Des().Append( *param );
    task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used
    CleanupStack::PopAndDestroy();
    }
    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

    I even tried to close the browser and restart the task, but failed to do so. I used the following code
    const TInt KWmlBrowserUid = 0x10008D39;// 0x1020724D for S60 3rd Ed

    TUid taskId( TUid::Uid( KWmlBrowserUid ) );
    TApaTaskList taskList( iEikonEnv->WsSession() );
    TApaTask task = taskList.FindApp( taskId );
    TBool taskClosed = ETrue;
    if ( task.Exists() )
    {
    taskClosed = EFalse;
    task.BringToForeground();
    //task.KillTask();
    task.EndTask();
    //task.SendSystemEvent(EApaSystemEventShutdown);
    for(int i=0;i<500;i++)
    {
    DoSomeOperation();
    taskClosed = ETrue;
    TApaTaskList taskList2( iEikonEnv->WsSession() );
    TApaTask task2 = taskList2.FindApp( taskId );
    if(!task2.Exists())
    {
    taskClosed = ETrue;
    break;
    }
    }

    }
    if(!taskClosed)
    return;
    ....the code for openeing a new browser continues here

    With this code the browser is closed, but it does not restart in the same session.

    I saw the cellspotting(http://www.cellspotting.com) application, it opens the browser more than 5 times without any problem.

    I tried with Nokia Browser Launch API, but when I restart my application without closing it, the browser is in front of the application which is not the required feature of the application.

    Can anybody help me?

  2. #2
    Registered User
    Join Date
    Apr 2009
    Posts
    17

    Re: Problem in launching web browser in S60 3rd Edition

    Hello,

    I am having a similar problem using the same code on the E71 as well. I believe the original code came from this Wiki article:

    http://wiki.forum.nokia.com/index.ph...in_3rd_edition

    In my case, the code works great if the browser isn't already running. But when the browser is already running, the browser is brought to the foreground, but the URL isn't opened. The web page previously opened in the browser remains active. I do however see a "flash" on the browser window, which leads me to believe that some (error?) message is being displayed, although too quickly to be read.

    My application follows the window client/server model, and so I use a RWsSession for the task list:

    RWsSession wsSession;
    User::LeaveIfError(wsSession.Connect());
    CleanupClosePushL(wsSession);

    TApaTaskList taskList( wsSession );
    TApaTask task = taskList.FindApp( id );

    My code is otherwise identical to the sample code provided in the Wiki article.

    I've also tried the CBrowserLauncher approach:

    http://wiki.forum.nokia.com/index.ph...r_Launcher_API

    Unfortunately the call to LaunchBrowserEmbeddedL crashes in my app with a "data" error. My guess is this is related to the window client/server model:

    CBrowserLauncher *launcher = CBrowserLauncher::NewL();
    launcher->LaunchBrowserEmbeddedL( *param, NULL, NULL, iOverriddenSettings );
    CleanupStack::PopAndDestroy();

    I'd certainly appreciate any tips to make the browser launch work on the E71 when the browser task is already running.

    Best regards,
    Brian

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Problem in launching web browser in S60 3rd Edition

    The actual panic code could help, check this for help: http://wiki.forum.nokia.com/index.ph...ded_panic_code

  4. #4
    Registered User
    Join Date
    Apr 2009
    Posts
    17

    Re: Problem in launching web browser in S60 3rd Edition

    Hello,

    Thank you for the quick reply. Using the CBrowserLauncher class, my application crashes with a KERN-EXEC 3 error. From what I've read, this usually indicates a stack overflow. Looking at the calling chain, I don't believe an excessive amount of recursive functions are on the stack. Also substituting the code used by sahidul for the CBrowserLauncher implementation eliminates the KERN-EXEC 3 error, so maybe the error is caused by something else.

    I currently specify a 20 KB stack using the EPOCSTACKSIZE directive. For grins I increased that to 32 KB and unfortunately that made no difference.

    It seems like this code nearly works perfectly, except that when the browser is already running, the new URL is not opened:

    http://wiki.forum.nokia.com/index.ph...in_3rd_edition

    So my preference is to sort out why the E71 browser fails to open in this case. The flash in the browser window when trying to open the new URL is telling... I wish I knew what failed! Could it be cause by some browser preference?

    Thanks again for helping with this issue.

    Regards,
    Brian

  5. #5
    Registered User
    Join Date
    Jun 2008
    Posts
    1

    Re: Problem in launching web browser in S60 3rd Edition

    Hi!

    Did you find any solution? I have exactly the same problem. If browser is already running, it is brought to foreground but new url is not opened.
    I'm using the very same code from the wiki example.

    Any help, anyone?

    Best regards,
    Teemu V.

  6. #6
    Registered User
    Join Date
    Apr 2009
    Posts
    17

    Re: Problem in launching web browser in S60 3rd Edition

    Hello -

    I've copied the code I'm using below. It does work and also opens the new URL if the browser is already running. Note you'll need to add the SwEvent capability to your application build.

    - Brian

    const TInt KWmlBrowserUid = 0x10008D39;
    TUid id( TUid::Uid( KWmlBrowserUid ) );
    RWsSession wsSession;

    User::LeaveIfError(wsSession.Connect());
    CleanupClosePushL(wsSession);

    TApaTaskList taskList( wsSession );
    TApaTask task = taskList.FindApp( id );

    if ( task.Exists() )
    {
    task.BringToForeground();
    HBufC8* param = HBufC8::NewLC( aUrl.Length() + 2);
    param->Des().Append(_L("4 "));
    param->Des().Append(aUrl);
    task.SendMessage( TUid::Uid( 0 ), *param ); // Uid is not used
    CleanupStack::PopAndDestroy(param);
    }
    else
    {
    HBufC16* param = HBufC16::NewLC( aUrl.Length() + 2);
    param->Des().Append(_L("4 "));
    param->Des().Append(aUrl);
    RApaLsSession appArcSession;
    // connect to AppArc server
    User::LeaveIfError(appArcSession.Connect());
    TThreadId id;
    appArcSession.StartDocument( *param, TUid::Uid( KWmlBrowserUid), id );
    appArcSession.Close();
    CleanupStack::PopAndDestroy(param);
    }

    CleanupStack::PopAndDestroy();

Similar Threads

  1. Replies: 35
    Last Post: 2009-04-11, 14:36
  2. drawRGB problem in landscape mode in S60 3rd edition FP1 emulator
    By retset in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2007-11-06, 10:39
  3. Recognizer in S60 3rd, problem with wap browser
    By bobbycalf in forum Mobile Java General
    Replies: 2
    Last Post: 2006-08-25, 20:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×