Your best solution without creating your own custom Android rom to remove the bottom buttons, will be to make the app full screen, override the back button, and make your app a launcher in order to override the home button.
AFAIK, there is no way of overriding the recent apps button.
Edit: One other option would to have a fullscreen app and then use a mount that will cover the buttons. (Thanks to MaciejGórski for the idea).
To make your app full screen, put the following in your activity's onCreate()
:
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Or you can make the app full screen from within the manifest as well, thanks to @Niels:
<application android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
To override the back button, add this method:
@Override
public void onBackPressed() {
return;
}
Now the home button is trickier, add the following to your manifest:
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
and this to your manifest under the <activity>
:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
and this to your manifest under the <application>
, make sure that the <receiver name>
is the full package name path you define:
<receiver android:name="com.example.BootCompleteReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
And lastly, create a java class file called BootCompleteReceiver, and use this code:
public class BootCompleteReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Intent startActivityIntent = new Intent(context, YourActivityName.class);
startActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(parentActivityIntent);
}
}
To later disable your app as a home screen launcher, press the recent app button, swipe down from the right side, tap settings, go to apps, then tap the upper right three dots (vertically aligned), press "Reset app preferences", and then finally press "Reset apps".
I think that should just about cover it all.
EDIT 2 I just realized/tested and you do NOT necessarily need the BOOT_COMPLETED
intent if you make your application a launcher. This means that the <uses-permission>
, <receiver>
, and BootComplete.java
are not needed. You can just use the <intent-filter>
that includes the MAIN, HOME, and DEFAULT attributes.
EDIT 3 More/different information available here: Home Launcher issue with Fragments after reboot