×
Namespaces

Variants
Actions
(Difference between revisions)

Closing the application via Task list

From Nokia Developer Wiki
Jump to: navigation, search
seppo_fn (Talk | contribs)
m
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Add ArticleMetadata)
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Symbian C++]][[Category:Usability]][[Category:Testing]][[Category:Code Examples]]
+
{{ArticleMetaData <!-- v1.2 -->
 +
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Qt SDK 1.1.4]) -->
 +
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 +
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20070314
 +
|author= [[User:Satu]]
 +
}}
 +
[[Category:Symbian C++]][[Category:Usability]][[Category:Testing]][[Category:Code Snippet]]
  
User should be able to close all applications via device's [[Task list]]. Task list is opened by pressing the Application key for a while. Then, use can select the application to be closed and press C key. This is important from the usability and user experience point of view as applications running in the background may consume a lot of memory and battery.  
+
User should be able to close all applications via device's task list. Task list is opened by pressing the Application key for a while. Then, use can select the application to be closed and press C key. This is important from the usability and user experience point of view as applications running in the background may consume a lot of memory and battery.  
  
Being able to close the application via Task list is a requirement in [[Symbian Signed]]. Application that cannot be closed via Task list, won't pass the tests and therefore cannot be Symbian Signed.
+
Being able to close the application via Task list is a requirement in [[Symbian Signed]], check for test case number "Task List (UNI-05)" . Application that cannot be closed via Task list, won't pass the tests and therefore cannot be Symbian Signed.
  
 +
* Application must not be closed via task list if its showing a dialog. So make sure that no dialog is showing during closing application via task list.
  
  
Line 37: Line 60:
 
where ''IsForeground()'' is provided by the ''CAknAppUiBase'' class.
 
where ''IsForeground()'' is provided by the ''CAknAppUiBase'' class.
  
 +
It is also important to allow the framework to be able to close the application without user intervention, in cases of low memory for instance.
 +
 +
[[Enabling app-closed notifications using Symbian C++]] details the notification mechanism for the same. The event can also be captured in the HandleWsEventL function of the appui class if required.
 +
 +
<code cpp>
 +
void CYourAppUi::HandleWsEventL (const TWsEvent &aEvent, CCoeControl *aDestination)
 +
{
 +
switch (aEvent.Type())
 +
{
 +
case EEventUser:
 +
{
 +
//Check if this is a System's call to the app for shut down
 +
if (( *reinterpret_cast<TApaSystemEvent*>(aEvent.EventData())) == EApaSystemEventShutdown)
 +
{
 +
                // Do something if required
 +
                }
 +
}
 +
            break;
 +
default:
 +
break;
 +
      CAknAppUi::HandleWsEventL(aEvent, aDestination);
 +
      }
 +
}
 +
</code>
  
 
==See also==
 
==See also==
* [[Common failures in Symbian Signed testing]]
+
* [[How to conform with Symbian Signed criteria]]
 +
* [[How to retrieve a list of currently running tasks?|How to retrieve a list of currently running tasks]]
  
 
<br>
 
<br>

Latest revision as of 10:30, 20 July 2012

Article Metadata
Article
Created: Satu (14 Mar 2007)
Last edited: hamishwillee (20 Jul 2012)

User should be able to close all applications via device's task list. Task list is opened by pressing the Application key for a while. Then, use can select the application to be closed and press C key. This is important from the usability and user experience point of view as applications running in the background may consume a lot of memory and battery.

Being able to close the application via Task list is a requirement in Symbian Signed, check for test case number "Task List (UNI-05)" . Application that cannot be closed via Task list, won't pass the tests and therefore cannot be Symbian Signed.

  • Application must not be closed via task list if its showing a dialog. So make sure that no dialog is showing during closing application via task list.


[edit] Solution

In order for an application to be closed through the Task list, it should handle the EEikCmdExit command either in the application UI or views. Independently of the current state, one of the application’s HandleCommandL() methods should react to EEikCmdExit and call Exit() on the application UI.

Note that an application cannot be closed through the Task list if it runs a confirmation dialog on exit, for example:


if(ConfirmExitL())
{
SaveL();
Exit();
}

where ConfirmExitL() displays a confirmation dialog. Consider removing the confirmation dialog, or running it only if the application is in the foreground. The above example could be rearranged as follows:


TBool reallyExit = IsForeground()?ConfirmExitL():ETrue;
if(reallyExit)
{
SaveL();
Exit();
}

where IsForeground() is provided by the CAknAppUiBase class.

It is also important to allow the framework to be able to close the application without user intervention, in cases of low memory for instance.

Enabling app-closed notifications using Symbian C++ details the notification mechanism for the same. The event can also be captured in the HandleWsEventL function of the appui class if required.

void CYourAppUi::HandleWsEventL (const TWsEvent &aEvent, CCoeControl *aDestination)
{
switch (aEvent.Type())
{
case EEventUser:
{
//Check if this is a System's call to the app for shut down
if (( *reinterpret_cast<TApaSystemEvent*>(aEvent.EventData())) == EApaSystemEventShutdown)
{
// Do something if required
}
}
break;
default:
break;
CAknAppUi::HandleWsEventL(aEvent, aDestination);
}
}

[edit] See also


This page was last modified on 20 July 2012, at 10:30.
87 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.

×