Archived:How to check if the native Symbian camera app is running
Archived: 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}}.
Article Metadata
Compatibility
Platform(s): S60 3rd Edition
Article
Created: User:Technical writer 1
(08 Feb 2008)
Last edited: hamishwillee
(14 Sep 2012)
Description
In order to find out whether the Camera application is running, TApaTaskList class can be used to retrieve a list of currently running tasks.
Note that on some devices, such as the Nokia N93 and the Nokia N93i, the Camera task is always running in the background and only hidden from the list of active task when in background.
Solution
The following function returns ETrue if the Camera is running and not hidden from the list of active tasks.
Capability requirements: none
#include <apgtask.h> // link against apgrfx.lib
#include <apgwgnam.h>
// The UID of the native camera application
const TUid KNativeCameraAppUID = { 0x101ffa86 };
TBool CheckCameraStatusL()
{
TUid id( KNativeCameraAppUID );
TApaTaskList taskList( iWsSession ); // iWsSession is of type RWsSession
TApaTask task = taskList.FindApp( id );
if( task.Exists() )
{
CApaWindowGroupName* wgName =
CApaWindowGroupName::NewLC( iWsSession, task.WgId() );
TBool isHidden = wgName->Hidden();
CleanupStack::PopAndDestroy(); // wgName
if(!isHidden)
{
return ETrue;
}
}
return EFalse;
}


(no comments yet)