Re: [android-developers] Password protect an app
On Sat, Jul 2, 2011 at 1:03 PM, Jump <rassol@gmail.com> wrote:
> I want to password protect my app so that whenever any activity that is
> owned by my app's process no longer is in the foreground and then comes back
> into foreground there should be a "enter password" dialogue.
> Is this possible?
IMHO this is a poor design. If the user gets a text message and
returns to your app within 5 seconds, you will force them to log in
again. This will cause users to attack you with cricket bats. Or
possibly just bats, or just crickets.
Instead, implement a credential timeout mechanism:
-- when they log in, note the time
-- in onResume() of each activity, check the time since last login,
and if the time gap is too long, then redirect to the login activity
-- if you want the user to not have to log in while they are in your
application, just update that time when you check it in onResume()
-- let the user choose the timeout period via a SharedPreference
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
_Android Programming Tutorials_ Version 3.5 Available!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home