Opening an HTML link in the web browser using Symbian C++
Article Metadata
Tested with
Devices(s): Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 3rd Edition
S60 5th Edition
S60 5th Edition
Platform 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.


(no comments yet)