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

Archived:How to check if the native Symbian camera app is running

Jump to: navigation, search
Archived.png
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;
}
281 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