Yes it is possible. This is a simple lock screen. Source code from GitHub
Creating an application that works like a lock does not make much difference, but as you said, for the problem with the Home key, I would suggest that you continue and develop the application as much as you need, and the only final area that you are stuck is therefore, we will try to find some difficult way to gain control of the home key and make it as an application for your lock application. It is not very difficult, but curiously difficult. I will send you a message if I find the source codes for accessing the home key.
PS:
Here is a tutorial to access your home key
I found somewhere that the house key has been redefined. Add these lines to the application manifest.
The next two lines will do the magic
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" />
and override this method in your activity
@Override public void onAttachedToWindow() { super.onAttachedToWindow(); this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_HOME) { Log.i("Home Button","Clicked"); } if(keyCode==KeyEvent.KEYCODE_BACK) { finish(); } return false; }
Keep in mind that I did not test these codes or methods, just tried to help you (you may find some flaws).
PS: based on the votes, which I can guarantee that my proposal works, and you can develop such an application using the above help :)
Kirk Jan 6 '14 at 6:16 2014-01-06 06:16
source share