Tip: Detect user idleness

Monday, June 30, 2008 at 3:34 PM



You can use framework.system.user.idle to detect whether the user is idle and might be away from the computer.

When the user is idle, you can choose to skip operations such as HTTP requests or audio playback:
if (framework.system.user.idle) {
// User is idle/away. No need to re-retrieve the content.
} else {
retrieveContent();
}
Have a tip you'd like to share? Send it to gd-developer AT google DOT com. To see all tips, choose the Tips label.

1 comment:

Teo said...

That's really interesting, maybe in the future we could have onIdle and onOutOfIdle events? :)