Symbian
Symbian OS Library

FAQ-0524 How do I launch the web browser seeded with a given URL?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Applications
Created: 10/18/2000 Modified: 04/16/2003
Number: FAQ-0524
Platform: Not Applicable

Question:
I would like to start the Web application from my program sending parameters to it. I would like to be able to specify the page the web browser initially loads up.

Answer:
To start the Web app, seeding it with a URL, you can use the following approach. This will also work for the Web browser in the Sony Ericsson P800 althought this is not Symbian's Web application, development for which was discontinued after v6.1 of Symbian OS.
(1) Create an RApaLsSession object and initialise it.

(2) Call RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) passing the web app's UID to get back aInfo filled in for Web. This will give you the name of the web dll.

(3) Create a CApaCommandLine.

(4) Call CApaCommandLine::SetLibraryNameL(const TDesC& aLibName), setting aLibName to TApaAppInfo.iFullName (created in .2). This guards against the name of the web dll being changed on the sly - it is UIDs that identify apps, not dll names.

(5) Call CApaCommandLine::SetDocumentNameL(const TDesC& aDocName), setting aDocName to be the URL you wish to access. NB This limits you to 256 character long URLs - you should check for this.

(6) Call RApaLsSession::StartApp(const CApaCommandLine& aCommandLine), passing in your constructed command line.

Class RApaLsSession is defined in apgcli.h, part of the apgrfx dll.

CApaCommandLine is defined in apacmdln.h (apparc.dll). It basically specifies the application to run, along with a commandline to pass to it.

TApaAppInfo is defined in apaid.h (apparc.dll).