Is it possible to make Android application, which can be closed only by buttons in a layout of that app and not with back&home HW/SW buttons?
I want to make one-purpose app for myself, I can set all permissions for the app.
You shouldn't be doing that. That's the whole purpose and concept of the Home button. If you could explain your use-case, may be there are alternate approaches.
In your current activity you can overide back buttons function using onBackPressed
method.
When you press Home button, onPause
method will be called (activity goes to paused stage). so you can overide it with your custom codes.
Back button- override onBackPressed and do not call super.onBackPressed. I don't think you can do home, but you can try trapping the keystroke.