Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 11:53, 15 February 2008.

CS000815 - Checking if the Camera application is running

From Forum Nokia Wiki


ID CS000815 Creation date February 8, 2008
Platform S60 3rd Edition Tested on devices  
Category Symbian C++ Subcategory Imaging, Application Framework
APIs   Classes  
Methods      

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 <agptask.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;
   }
Related Discussions
Thread Thread Starter Forum Replies Last Post
Nokia 6131 Camera Issue jurome General Discussion 4 2007-03-14 03:40
camera settings 7650 betasuppe General Symbian C++ 2 2003-02-04 13:36
Is it possible to geotag photos in Java ME Larry101 Mobile Java General 4 2008-02-12 19:50
Take a photo with N70 asmobease Symbian Media (Graphics & Sounds) 6 2006-11-26 18:39
running at background neo002 Mobile Java General 1 2003-08-08 05:27
 
Powered by MediaWiki