Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Removing home and navigation button

I'm trying to remove the Home button and the Multithread button. The idea is to remove it completely from the running application, better if we can remove it completely from every application on the tablet we are working with. Using full-screen is not something that we want, since the user shouldn't be able to exit the full screen mode, even if he wants it (it's a custom commercial app, it's the desired behaviour for multiple reasons).

Nexus 10 without the home and navigation buttons

This is the result on a Nexus 10. We accomplished that by taking the SystemUI sources and changing them before compiling the CyanogenMod.

Unfortunately we have to replicate that in an Asus ZenPad 10, that has no CyanogenMod available. We have a version that allows us to create system applications, but change every application into a system application is not something that we want.

We have found in this link: http://developer.oesf.biz/em/developer/reference/eggplant/constant-values.html#android.view.View.STATUS_BAR_DISABLE_HOME

That there are flags for disabling the home button and the navigation button, but they are usable only with system applications.

We have tried to get the SystemUI.apk already compiled in the tablet, decompile it and change it. The problem is that or we have useless smali files or with have only res/ and AndroidManifest.xml files (Asus changed the SystemUI.apk into two apks of it own).

So... we are a little desperate here ahah. Looking for hints / ideas to try to remove that buttons. Better without recompiling or doing some strange thing.

like image 256
Filnik Avatar asked Dec 03 '15 11:12

Filnik


2 Answers

This is possible using a combination of permissions like Immersive Full-Screen Mode combined with the SYSTEM_UI_FLAG_HIDE_NAVIGATION and SYSTEM_UI_FLAG_FULLSCREEN flags. These flags hide the navigation and status bar, now that you have a blank screen put a linear laoyout at the bottom of the screen with only the back icon visible, just to create the effect of what you want. ALSO note that it is important to understand that once the user swipes upwards the normal navigation bar will be visible(not sure if it can be handeled through intercept touch event).

Alternatively you can try out this solution mentioned here also How to disable Home and other system buttons in Android?

also refer this github project(works if there is only a hardware navigation buttons) https://github.com/shaobin0604/Android-HomeKey-Locker

Last But not the least There is an answer by commsware that throws more light on this subject might come in handy. Not able disable Home button on specific android devices

like image 189
Mightian Avatar answered Sep 20 '22 14:09

Mightian


Try Android for work APIs and refer here.Using this apis you can get full control of the device and disable whatever you want.The device can be used only for single app.

Corporate-owned, single-use (COSU) is a subset of the corp-liable scenario for shared or special-use devices. Unlike corp-liable devices that are associated with individual employees, COSU devices are associated with particular business functions. For example, a COSU device might be used as a kiosk.

You can also try to integrate custom MDM(Mobile device management) solution provided by OEMS/MDM vendors/MDM partners like Samsung, HTC, Airwatch etc. This work on devices prior to lollipop too and provide more APIs to control the device than provided by default android solution.

I know Samsung MDM/Knox solution is good and it has APIs to control each and every part of the device.Refer- http://www.samsung.com/levant/business/solutions-services/mobile-solutions/security/mobile-device-management.They have Kiosk mode which is similar to COSU.

like image 30
rupesh jain Avatar answered Sep 22 '22 14:09

rupesh jain