954,554 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to capture the system idle time using java

want to capture the system idle time. Means if the user did not press any key or did not move the mouse then it is considered as system idle time. I want the code for this in Java on windows operating system. Please help me.

ravinderreddy
Newbie Poster
3 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

Please show some effort before asking for help.

server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
 

Hi everyone,

There is no easy solution to your question. You will have to use JNI.

But if you want the solution for the idle time for an application then get the first current time and get the current time for the the next event and minus them. That will get you the idle time for an application

Richard west

freesoft_2000
Practically a Master Poster
623 posts since Jun 2004
Reputation Points: 25
Solved Threads: 10
 

I wrote an entry on my blog that shows simple code to get the idle time on Windows in Java, using the JNA library (Java Native Access, not to be confounded with JNI) and the Windows GetLastInputInfo API call.
Hope it helps...

zOlive
Newbie Poster
1 post since Oct 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You