×
Namespaces

Variants
Actions

Archived:Launching the Web browser on S60 3rd Edition to open a specified URL

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

This article shows how to launch the Web browser on S60 3rd Edition to open a specified URL.

Article Metadata
Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Platform Security
Signing Required: DevCert
Capabilities: SWEvent
Article
Created: User:Technical writer 2 (04 May 2006)
Last edited: lpvalente (18 Nov 2012)

Description

In order to launch the Web browser on S60 3rd Edition and have it automatically open a specified URL, the application must have the SWEvent capability. Note that the UID of the OSS browser in S60 3rd Edition is 0x1020724D and from S60 3rd Edition, FP1 onwards 0x10008D39.

Reference code:

RApaLsSession apaLsSession;
const TUid KOSSBrowserUidValue = {0x10008D39}; // 0x1020724D for S60 3rd Ed
 
HBufC* param = HBufC::NewLC(64);
param->Des().Copy(_L("4 http://www.yahoo.com/"));
 
TUid id(KOSSBrowserUidValue);
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 not used
CleanupStack::PopAndDestroy(param8);
} else {
if(!apaLsSession.Handle()) {
User::LeaveIfError(apaLsSession.Connect());
}
TThreadId thread;
User::LeaveIfError(apaLsSession.StartDocument(*param, KOSSBrowserUidValue, thread));
apaLsSession.Close();
}
CleanupStack::PopAndDestroy(param);

Note: If the browser is currently in the process of loading an URL and an external application tries to open another one, the error "Unable to retrieve" is shown and the new URL is not loaded.
See also topic Archived:Different browser UIDs in S60 3rd Edition (inital release) and FP1.

Here is some additional information about the parameters that are passed as command line arguments when launching the OSS Browser:

  1. Start/Continue the browser and nothing is specified (the default case)
    => Parameter = <Any text>
  2. Start/Continue the browser specifying a Bookmark
    => Parameter = “1”+”<Space>“+”<Uid of the Bookmark>”
  3. Start/Continue the browser specifying a Saved deck
    => Parameter = “2”+” <Space>“+”<Uid of the Saved deck>”
  4. Start/Continue the browser specifying a URL
    => Parameter = “4”+” <Space>“+”<Url>”
  5. Start/Continue the browser specifying a URL and an Access Point
    => Parameter = “4”+”<Space>“+”<Url>”+”<Space>“+”<Uid of Ap>”
  6. Start/Continue the browser with the start page. (Used when starting the browser with a long press of “0” in the Idle state of the phone.
    => Parameter = “5”
  7. Start/Continue the browser specifying a Bookmark folder
    => Parameter = “6”+” <Space>“+”<Uid of the Folder>”

Browser Launcher API

The SDK API Plug-in package for S60 3rd Edition SDKs includes the Browser Launcher API. CBrowserLauncher class will automatically determine which browser to launch.

Parameters passed to this API are in the same format as above:

CBrowserLauncher* launcher = CBrowserLauncher::NewLC();
launcher->LaunchBrowserEmbeddedL(_L("4 http://www.nokia.com"));
CleanupStack::PopAndDestroy(launcher);
This page was last modified on 18 November 2012, at 00:44.
53 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×