Menu

1 / 2

AndroidAppLockscreen: drop a PIN lockscreen into any Android app in minutes

DEV Community·Fayaz Bin Salam·6 months ago
#VX9HTkiM
#android#opensource#security#showdev#password
Reading 0:00
15s threshold

most android apps that need any kind of auth go straight to biometrics or firebase. fine — but what if you just need a simple PIN lockscreen? no backend, no cloud calls, just "enter your code to continue".

that's what AndroidAppLockscreen does.

i built it after copy-pasting the same lockscreen implementation across three different projects. the design is inspired by Diary — clean, minimal, nothing fancy.

what it handles

set password

check password on launch

change password

disable password

forgot password flow

customisable background color

setup

add the JitPack repo and one dependency:

implementation 'com.github.p32929:AndroidAppLockscreen:1.2'

Enter fullscreen mode

Exit fullscreen mode

extend your activities with LockscreenHandler , then in MainActivity 's onCreate :

EasyLock . checkPassword ( this );

Enter fullscreen mode

Exit fullscreen mode

first launch, no password set → does nothing. password set → blocks app until correct code is entered.

managing passwords after that:

EasyLock .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.