Lock application + screen-saver


Hi all,

How would I go about locking an application so that one would need to re-enter a username and password to gain entry again. I know thats very vague so here goes;

Background:
Im new to C# and developing a C# mobile app which displays confidential info to the user. Ideally, if the user has not tapped the screen for x minutes, the application should lock itself and not permit the user to see what it was displaying. This functionality should also be available as an icon incase the user voluntarily wants to lock the application.

This are my thoughts on accomplishing this:
Have a thread that monitors for taps and if the time between last tap exceeds a certain threshold, then the screen lock is called (Is this possible in C# ). If the user taps the lock icon, then the screen lock should be called anyways. This therefore entails that I also write a screen-saver of some type that gets invoked and hides the application.

Okay..thats the idea. As mentioned previously, I am new to C# and my thoughts may be too simplistic or too complicated i.e not a good C# way of solving the problem. Im learning C# as I write this application and as such Im always open to ideas. Any ideas are greatly appreciated.

<Nick>


Answer this question

Lock application + screen-saver

  • leopord

    It might be difficult to find every place where the user could tap on your application and record when that happened.

    How about if you have two buttons. The first is "lock now". The second is a countdown that ticks down every second on a timer. If the countdown ever goes to zero, you remove/hide your UI and put up the login screen UI. If the user clicks on the countdown button, it resets to whatever max you specify (5 minutes ).



  • Dhondtie

    Hey Tim,

    Thanks a lot. I went with your idea and it works like a charm. Thanks again!!

    Nick

  • Lock application + screen-saver