×
Namespaces

Variants
Actions

How to Launch Browser in 3rd edition

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}}.

The article is believed to be still valid for the original topic scope.


Article Metadata
Article
Created: bharatuppal (15 Jul 2007)
Last edited: lpvalente (26 May 2013)

This article demonstrates how to launch the web browser in the 3rd Edition devices.

Headers Required:

#include <apgtask.h>
#include <apgcli.h>

Library Needed:

LIBRARY  apgrfx.lib

Source:

// ----------------------------------------------------
// CBrowserAppUi::LaunchBrowserL(const TDesC& aUrl)
// Used for launching the default browser with provided url.
// ----------------------------------------------------
//
void CBrowserAppUi::LaunchBrowserL(const TDesC& aUrl)
{
const TInt KWmlBrowserUid = 0x10008D39;
TUid id( TUid::Uid( KWmlBrowserUid ) );
TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
TApaTask task = taskList.FindApp( id );
if ( task.Exists() )
{
HBufC8* param = HBufC8::NewLC( aUrl.Length() + 2);
//"4 " is to Start/Continue the browser specifying a URL
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);
//"4 " is to Start/Continue the browser specifying a URL
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);
}
}


Additional information about the parameters that are passed as command line arguments when launching the 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>

Note: the UID should have WAP ID value, not IAP ID

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>


Related Links:

This page was last modified on 26 May 2013, at 16:43.
45 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.

×