Namespaces
Variants
Actions

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

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 (20 Nov 2012)

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 20 November 2012, at 02:25.
114 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