I need to determine if a user’s been idle for a certain period of time.
If they have been idle, the app logs the user out.
I’ve combed the web and MS site am unable to find a property which basically returns a Boolean indicating is the user is inactive.
The closest thing I’ve found is a property which can enable or disable theUserIdleDetectionMode. Namely:
PhoneApplicationService.UserIdleDetectionMode Property
Can anyone tell me how I can problematically detect that a user has been inactive for a period of time within a Windows Phone app?
I don’t believe there is a way to detect when a user is idle. You could let the phone do that for you and log the user out when the app is tombstoned. The only problem with this approach is the time the app gets tomstoned could vary.
See, WP7 App lifecyle
So when the Deactivated event fires, you could log the user out right before the app is tombstoned.