Namespaces
Variants
Actions
Revision as of 03:29, 14 September 2012 by hamishwillee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Jump to: navigation, search
Article Metadata

Tested with
Devices(s): Nokia 5800 XpressMusic

Compatibility
Platform(s): S60 3rd 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.


See also

235 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved