×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 29

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Location
    UK
    Posts
    159

    launching wap browser with URL

    I'm trying to launch the WAP Browser (wmlBrowser.app on the device, browser.app on the emulator) at a local file; and I'm having problems. In fact I'm having problems launching it with a URL at the moment...

    The code I've found (from here somewhere) is:

    void CMyDocument::LaunchURL(CMyString& aLink)
    {
    #ifdef __WINS__
    _LIT(KToDoFileName, "z:\\System\\Apps\\Browser\\Browser.app");
    #else
    _LIT(KToDoFileName, "z:\\System\\Apps\\WmlBrowser\\WmlBrowser.app");
    #endif

    CApaCommandLine* cmdLine=CApaCommandLine::NewLC();
    cmdLine->SetCommandL(EApaCommandOpen);
    cmdLine->SetLibraryNameL(KToDoFileName);

    TPtr url((unsigned short *)aLink.Cstr(), aLink.Size());
    HBufC * arg = HBufC::NewLC(url.Length()+3);
    *arg = _L("4 ");
    arg->Des().Append(url);

    cmdLine->SetDocumentNameL(*arg);
    EikDll::StartAppL(*cmdLine);
    CleanupStack::PopAndDestroy(2); // cmdLine, arg
    }

    This launches the WAP browser, and seems to try to launch the URL passed in - but (even before trying to connect) says that the URL is invalid. Does anyone know what format is valid? I've tried a few variations but the error always pops up saying "check url"

    And beyond that... does anyone know how (if?) I can point it at a .wml deck on the c: drive?

    And finally... does anyone know what the other launch codes are? '4' in the above code seems to be the magic number for launching a URL... so what about 0, 1,2 and 3???


    Cheers
    Russell

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    UK
    Posts
    159
    I've been doing some more investigation... and have got a tiny bit further, maybe.

    If I use quotes around the URL in the document, things change. So I use:

    "4 \"http://wap.yahoo.com/\""

    The emulator shows the name as it's passed in (in an info message thingy), and the phone doesn't complain any more... but it doesn't actually make the brwoser launch anything...

    Am I realy going to have to mask the browser app with my own and grab the command line when it's launched from the SMS app?????

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    12
    Try removing the " \" " before the http. I got this to work on the 3650 device. Didn't try it in the emulator.

    TFileName AppToLaunch;
    TBuf<100> iDoc;
    AppToLaunch = \\system\\apps\\browser\\browser.app;
    iDoc = _L("4 http://wap.yahoo.com/");

    CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
    cmdLine->SetLibraryNameL(AppToLaunch);

    if (iDoc != _L(""))
    cmdLine->SetDocumentNameL(iDoc);

    cmdLine->SetCommandL(EApaCommandOpen);
    RApaLsSession ls;
    User::LeaveIfError(ls.Connect());
    handle = ls.Handle();
    ls.EmbeddableAppCount(initialAppCount);
    CleanupClosePushL(ls);
    User::LeaveIfError(ls.StartApp(*cmdLine));
    CleanupStack::PopAndDestroy(2);

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Location
    UK
    Posts
    159
    Cheers - that worked.

  5. #5
    Registered User
    Join Date
    Jun 2003
    Location
    Montreal
    Posts
    1
    Hi, there is a bug with this method, if the wap browser is already open, the browser will be restored with his current state since the OS will not restart the application.

    So the command line arguments are ignored and the url is never sent to the browser.

    Does anyone know how to solve that?

  6. #6
    Regular Contributor
    Join Date
    Apr 2003
    Posts
    52
    everything is explained in the document "utilizing external application views" from nokia

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    23
    I tried what was suggested by the "Utilizing External Application Views" for launching WAP but it doesn't seem to work. If it is not currently running, it will launch WAP but it will just freeze and you have to re-boot.

    If WAP is running, I get a "System Error" but it still launches the new URL.

    Any ideas or thoughts? Below is a snippet of code of how I am implementing it.

    if(iSettings->iAppModuleList[iSelectedIndex]->iDisplayName == _L("WAP"))
    {
    HBufC* param = HBufC::NewLC( 20 );
    param->Des().Copy(iSettings->iAppModuleList[iSelectedIndex]->iDocument);
    TUid id(TUid::Uid(AppUid));
    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);
    CleanupStack::PopAndDestroy();
    }
    else
    {
    RApaLsSession appArcSession;
    User::LeaveIfError(appArcSession.Connect());
    TThreadId id;
    appArcSession.StartDocument(*param, TUid::Uid(AppUid), id);
    appArcSession.Close();
    }

    CleanupStack::PopAndDestroy();
    }

  8. #8
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: launching wap browser with URL

    Hi RGUIA

    I too have tried the same earlier and facing the same problem. The browser is freezing and I have to restart the OS. However its happening at times and not happening at times..... so a little confused....

    Did you get any solutions to it...

    Would be great if you could help...

    Thanks in advance

    Amit Kankani
    India

    Quote Originally Posted by rguia
    I tried what was suggested by the "Utilizing External Application Views" for launching WAP but it doesn't seem to work. If it is not currently running, it will launch WAP but it will just freeze and you have to re-boot.

    If WAP is running, I get a "System Error" but it still launches the new URL.

    Any ideas or thoughts? Below is a snippet of code of how I am implementing it.

    if(iSettings->iAppModuleList[iSelectedIndex]->iDisplayName == _L("WAP"))
    {
    HBufC* param = HBufC::NewLC( 20 );
    param->Des().Copy(iSettings->iAppModuleList[iSelectedIndex]->iDocument);
    TUid id(TUid::Uid(AppUid));
    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);
    CleanupStack::PopAndDestroy();
    }
    else
    {
    RApaLsSession appArcSession;
    User::LeaveIfError(appArcSession.Connect());
    TThreadId id;
    appArcSession.StartDocument(*param, TUid::Uid(AppUid), id);
    appArcSession.Close();
    }

    CleanupStack::PopAndDestroy();
    }

  9. #9
    Nokia Developer Champion
    Join Date
    Oct 2006
    Location
    Bangalore, India
    Posts
    1,572

    Re: launching wap browser with URL

    Quote Originally Posted by rguia
    I tried what was suggested by the "Utilizing External Application Views" for launching WAP but it doesn't seem to work. If it is not currently running, it will launch WAP but it will just freeze and you have to re-boot.

    If WAP is running, I get a "System Error" but it still launches the new URL.

    Any ideas or thoughts? Below is a snippet of code of how I am implementing it.

    if(iSettings->iAppModuleList[iSelectedIndex]->iDisplayName == _L("WAP"))
    {
    HBufC* param = HBufC::NewLC( 20 );
    param->Des().Copy(iSettings->iAppModuleList[iSelectedIndex]->iDocument);
    TUid id(TUid::Uid(AppUid));
    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);
    CleanupStack::PopAndDestroy();
    }
    else
    {
    RApaLsSession appArcSession;
    User::LeaveIfError(appArcSession.Connect());
    TThreadId id;
    appArcSession.StartDocument(*param, TUid::Uid(AppUid), id);
    appArcSession.Close();
    }

    CleanupStack::PopAndDestroy();
    }
    I am too facing the same problem of BROWSER freezing, please help...

  10. #10
    Registered User
    Join Date
    Jul 2008
    Posts
    4

    Smile Re: launching wap browser with URL

    hi there - i am new to this stuff and downloaded the zip file...how do I get it working on the phones. Whats the deployment procedure...thanks a ton....

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: launching wap browser with URL

    Search for getting started in the Wiki as a first try. FN main site also has such section (www.forum.nokia.com Documentation/Symbian C++, Getting started).

  12. #12
    Registered User
    Join Date
    Jul 2008
    Posts
    4

    Re: launching wap browser with URL

    is there not like an exe that you download to your phone that does this all for you or is it a bit more complicated. I just want to install an app on the phone that opens a pre-defined URL...again is this more complicating than it sounds?

  13. #13
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: launching wap browser with URL

    I do not know "the zip file" you have downloaded, it may or may not contain a .sis/.sisx file which is installable on the device.

  14. #14
    Super Contributor
    Join Date
    Mar 2003
    Location
    Beijing
    Posts
    3,609
    Hi,

    Attached please find my sample code. It works beautifully. Should you have any problems, please let me know.

    Hope this solves your problem!

    Liuxg
    Forum Nokia
    Attached Files Attached Files

  15. #15
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    54

    Getting browser to work on emulator

    What does one need to do to get the programatic browser opening to work on the Series 60 emulator? Do I have to install or configure some WAP proxy thing?

    I already have the sockets example working using the virtual serial port, etc. I am running the emulator on Windows XP Pro.

Posting Permissions

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