You Are Here:

Community: Wiki

This page was last modified 11:12, 9 June 2009.

How to Launch Browser in 3rd edition

From Forum Nokia Wiki

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>

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:

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditFurlTechnocratiMagnoliaTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fImageE3aMobilewebE2ezipX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfnTypeZCommunityContentQ qdcZtypeQUqfnTypeZE52esourceQ qdcZtypeQUqfnTypeZWebpageQ qdcZtypeQUqfnTypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZbrowsingQ qfnZtopicQUqfnTopicZwebE5ftechnologyQ qfnZtypeQUqfnTypeZCommunityContentQ qfnZtypeQUqfnTypeZE52esourceQ qfnZtypeQUqfnTypeZWebpageQ qfnZtypeQUqfnTypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfnTypeZCommunityContentQ qrdfZtypeQUqfnTypeZE52esourceQ qrdfZtypeQUqfnTypeZWebpageQ qrdfZtypeQUqfnTypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ