×
Namespaces

Variants
Actions

How to get notification of user activity when the device has been idle

From Nokia Developer Wiki
Jump to: navigation, search

This article shows how to get a notification of user activity when the device has been idle

Article Metadata
Compatibility
Platform(s): S60 platform
Series 80 1st Edition
Series 80 2nd Edition
Article
Created: User:Technical writer 2 (21 Jul 2005)
Last edited: hamishwillee (30 May 2013)

Description

How to implement a mechanism that gives an application a notification of user activity when the device has been idle?

Solution

Write an "Activity Manager" CTimer that monitors InactivityTime. When the CTimer launches, do

TTimeIntervalSeconds inactiveTime = User::InactivityTime();
if (inactiveTime < KMyActivityManagerTimerInterval)
{
CTimer::Cancel();
NotifyApplicationOfUserActivityL();
}

Summary

You can implement an "Activity Manager" by using CTimer. When the timer launches, compare the timer interval to Inactivity Time. If the Inactivity Time is smaller than the timer interval, you know that there has been activity while the timer was counting.

This page was last modified on 30 May 2013, at 04:38.
38 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.

×