Namespaces
Variants
Actions

Embedded camera view in a Symbian C++ app

Jump to: navigation, search



Article Metadata

Compatibility
Platform(s): S60 1st Edition
S60 2nd Edition

Article
Created: User:Technical writer 2 (04 Mar 2003)
Last edited: hamishwillee (13 Sep 2012)

Overview

How can I add the camera view to an application, such as the Insert->New Image option in the Messaging Application?

Description

The following code lines demonstrate how to embed the camera application within an application. Besides the function that starts the camera application, MApaEmbeddedDocObserver::NotifyExit() must be implemented. It is called when the user has exited the camera application.

Solution

void MyApplication::NewImage()
{
const TUid KUidCamera = { 0x1000593F };
RApaLsSession apaLs;
TApaAppInfo appInfo;
CApaDocument* doc = NULL;
CEikProcess* process = CEikonEnv::Static()->Process();
User::LeaveIfError(apaLs.Connect());
CleanupClosePushL(apaLs);
User::LeaveIfError(apaLs.GetAppInfo(appInfo, KUidCamera));
doc = process->AddNewDocumentL(appInfo.iCaption, KUidCamera);
CleanupStack::PopAndDestroy(); // apaLs
TApaDocCleanupItem cleanup(process, doc);
CleanupStack::PushL(cleanup);
doc->NewDocumentL();
CleanupStack::Pop(); // cleanup
doc->EditL(this, ETrue);
}
void MyApplication::NotifyExit(TExitMode aMode)
{
// camera view has been closed
}
This page was last modified on 13 September 2012, at 09:55.
106 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