I wrote a post about How to write simple Android Lock Screen
In short, you can run a service that contains BroadcastReceiver that will listen to any event of Intent.ACTION_SCREEN_OFF, then you can draw your custom Lock Screen on top of everything by using android.permission.SYSTEM_ALERT_WINDOW.