×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    54

    Opening WAP browser on local file

    In section 3.1.5.1 of "Utilizing_External_App_Views_v1_0.pdf" there is an example of how to start the Series 60 WAP browser for a particular URL. This same topic is also discussed a few times on various discussion groups. One of the best discussions can be found on the nokia discussion forums under the title "lauching wap browser with URL". Try the following URL to the post: http://discussion.forum.nokia.com/fo...2442#post62442 The Nokia discussion thread even includes an example application that demonstrates such usage.

    Now what I want to do is to open a local wml file which includes links to WAP sites on the web. I expect doing this is almost identical to the above. The line in the examples where I think the change will be is as follows:

    param->Des().Copy( _L("4 wap.yahoo.com/") );

    Now my guess is that the number 4 somehow changes when opening a file, but I don't really know. Can anyone provide guidance here?

    A second question to which I don't yet know the answer (since I'm still developing on the emulator) is can I go to a URL with a file component (i.e. http://wap.yahoo.com/somedirectory/somethingtoread.wml)? My current assumption is that doing this won't be a problem. Does anyone reading this know for sure?


    ---------------------------------
    Now just to keep you from having to chase down the example code for opening a URL I have copied it below:

    HBufC* param = HBufC::NewLC( 20 );

    //param->Des().Copy( _L( "4 http://wap.yahoo.com/" ) );

    param->Des().Copy( _L( "4 wap.yahoo.com/" ) );

    // Wap Browser's constants UId

    const TInt KWmlBrowserUid = 0x10008D39;

    TUid id( TUid::Uid( KWmlBrowserUid ) );

    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();

    }

    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


    Sincerely,
    James Carpenter
    nawkboy@yahoo.com

  2. #2
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122
    Just pass in a local file URL like "file:///local.wmlc". Passing in a path component should not be a problem either.

    Lauri

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

    The example excluded http

    >Just pass in a local file URL like "file:///local.wmlc".
    Why should that work? The example specifically removes the http:// from what it uses to open the browser.

  4. #4
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122
    It works either way. If the scheme part is omitted, it will default to http.

    You can test it yourself: download the sample code from http://discussion.forum.nokia.com/fo...threadid=21756 and change the URL in AppUi::HandleCommandL() to "file:///hello.wmlc". The wmlc file is supplied with the SDK.

    Lauri

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

    Thanks

    I had no idea I could leave the http part on although I found it very odd I had to remove it. Thats very good to know.

Posting Permissions

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