×
Namespaces

Variants
Actions

Opening an HTML link in the web browser using Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Nokia 5800 XpressMusic
CompatibilityPlatform Security
Signing Required: Self Signed
Capabilities: None
Article
Keywords: RApaLsSession, TDataType
Created: tepaa (07 May 2009)
Last edited: hamishwillee (14 Sep 2012)

Contents

Overview

This snippet demonstrates how to open an HTML link in the web browser.

MMP file

The following libraries and capabilities are required:

CAPABILITY None
LIBRARY apmime.lib // TDataType
LIBRARY apgrfx.lib // RApaLsSession

Header file

#include <APGCLI.H>
#include <APMSTD.H>


Source file

// Create session
RApaLsSession session;
User::LeaveIfError(session.Connect());
CleanupClosePushL(session);
 
// Gets the default application UID for for the given MIME type
TUid uid;
TDataType dataType(_L8("text/html"));
session.AppForDataType(dataType,uid);
 
// Runs the default application using the dataType
TThreadId threadId;
User::LeaveIfError(session.StartDocument(_L("http://www.google.com"), dataType, threadId));
 
CleanupStack::PopAndDestroy(); // session


Postconditions

The HTML link www.google.com is opened in the web browser.


See also

This page was last modified on 14 September 2012, at 03:29.
87 page views in the last 30 days.