×
Namespaces

Variants
Actions

Launching Media Gallery from another Symbian app

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
Tested with
Devices(s): Nokia E61i
Nokia E90 Communicator
Compatibility
Platform(s): S60 3rd Edition, MR
S60 3rd Edition, FP1
S60 3rd Edition, FP2
S60 3rd Edition FP2
S60 3rd Edition FP1
Article
Keywords: CCoeAppUi, TVwsViewId, RApaLsSession, TApaAppInfo,CCoeAppUi::ActivateViewL(const TVwsViewId& aViewId)
Created: tapiolaitinen (15 Feb 2008)
Last edited: hamishwillee (30 May 2013)

Contents

Overview

This code snippet demonstrates how to launch the Media Gallery application from another application.

This snippet can be self-signed.

MMP file

The following libraries are required:

  • LIBRARY    apgrfx.lib

Source file

#ifndef __SERIES60_3X__
#include <apgcli.h>
#endif
// The native Media Gallery application's UID in S60 2nd Edition, FP2 and newer,
// including S60 3rd Edition.
const TInt KGalleryUID3Post2ndEdFP1 = 0x101F8599;
 
// The native Media Gallery application's UID in S60 2nd Edition, FP1 and older.
const TInt KGalleryUID3Pre2ndEdFP1 = 0x101F4D8F;
 
// Gallery application's list view UID
const TInt KMediaGalleryListViewUID = 0x00000001;
 
TInt galleryUID3;
#ifdef __SERIES60_3X__
galleryUID3 = KGalleryUID3Post2ndEdFP1;
#else
// In S60 2nd Edition you need to resolve which of the two UID3s is
// valid
RApaLsSession lsSession;
User::LeaveIfError(lsSession.Connect());
CleanupClosePushL(lsSession);
lsSession.GetAllApps(); // Prepare the server
TApaAppInfo aInfo;
// Try to get the Media Gallery application info
if (lsSession.GetAppInfo(aInfo,
TUid::Uid(KGalleryUID3Pre2ndEdFP1)) == KErrNotFound)
{
// Media Gallery was not found with UID3
// KGalleryUID3Pre2ndEdFP1, thus the platform is
// 2nd Ed. FP2 or newer
galleryUID3 = KGalleryUID3Post2ndEdFP1;
}
else
{
// The platform is S60 2nd Edition, FP1 or older
galleryUID3 = KGalleryUID3Pre2ndEdFP1;
}
CleanupStack::PopAndDestroy(&lsSession);
#endif
 
// Gets viewId to activate Media Gallery view
TVwsViewId id = TVwsViewId(TUid::Uid(galleryUID3),
TUid::Uid(KMediaGalleryListViewUID));
ActivateViewL(id);

Postconditions

The Media Gallery application is launched.

See also

This page was last modified on 30 May 2013, at 07:39.
182 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.

×