Archived:How to check if the application is in background
For some programs it may be useful to know whether they are running in the background or in the foreground. This is how to check the focus state of a program (using the standard PySymbian appuifw module):
#A function that tells us the focus status of the application is defined
if(status==1):print 'App is now in the foreground'
else:print 'App is now in the background'
#We assign the function to the focus item of the Application class in appuifw