
There are many ways to create a dedicated device. For Android, it’s even easier to do. But every approach has its pros and cons. In this article, we’ll learn about this in detail.
Topics covered in this article:
- What is a Dedicated Device?
- Rule book for Dedicated Device Apps.
- Different approaches to creating a dedicated Android device.
- Using a hybrid approach: Gains and losses.
- Code in action!
- What’s next?
What is a Dedicated Device?
By definition:
A dedicated device is a specialized device that is built to perform a specific task or set of tasks. Dedicated devices are different from general-purpose devices like smartphones or computers that can run a wide range of applications.
In simple words:
A device that runs your app, and your app only!
You may come across many terminologies for this, such as ‘Single App Mode’, ‘Kiosk App’, ‘Dedicated Device’, etc. But this is nothing but the same Pizza with different toppings!
Examples:
- ATM and Cash Deposit Machines.
- Self-checkout machine in Decathlon.
- The Kiosk systems we see and use at malls.
- The menu tablet in fancy restaurants.
- The experience tablet in Royal Enfield showrooms.
Rule book for Dedicated Device Apps
Following are the must-haves that the app needs to be considered as a Dedicated device app.
- The system should have your app running all the time.
- The system should prevent the user from exiting your app by all means (pressing the back and home buttons, restarting the device, opening other apps using some shortcuts, etc.)
- The system should not allow the user to uninstall your app.
- The app should start on its own if it crashes, the device reboots, wakes from a deep sleep, or starts after a shutdown, etc.
Different approaches to creating a dedicated Android device
- System App: This makes your app a part of the OS, so it can’t be removed easily. Gives your app special privileges to make it comply with our needs, but you need Root Access for this.
- Enterprise Managed Device: This gives you greater control, and powers to remotely manage the entire device, but comes with a cost (we’ll see that in a moment).
- Device Administrator App: This allows your app to be treated similarly to a system app, and gives some powers to manage the device like the above approach, but has limitations.
- Home Screen App: This allows your app to become the home screen. So it always running and auto starts on closure. But user can uninstall this.
Using a hybrid approach: Gains and losses
Here we’re talking about using a combination of a Device Administrator App, a Home Screen App and a few tweaks on top. The easier, more affordable workaround.
Reasons:
- Why not Android Enterprise method?
Ans: Two reasons:
1. We want our data and activity to be private and within our control.
2. We do not want to be dependent on a specific service platform. - Why not System app method?
Ans: We do not have root enabled device, nor we want to unlock the device. - And we do not need our devices to be completely hardened (some of the system features and UI is still needed).
What do we gain?
- Can be easily developed.
- No external service or platform registration required.
- Can be setup on any Android device without the need of running any special scripts!
What do we lose?
- Complete remote control on device.
- A smart-ass with a little Android development knowledge can bipass this and have our app removed from the device! (which was okay for us at this stage)
Code in action!

So let’s consider you have a Android app, which you want to be enabled with this feature. Follow the below steps and you’re done!
Setup Admin Receiver
This class works as a receiver for Device admin events. You can extend the functionality by adding event listeners if you wish to make use of this. Click on link below to learn more.
https://developer.android.com/reference/android/app/admin/DeviceAdminReceiver
Create device admin receiver class
package com.example.myapp;
import android.app.admin.DeviceAdminReceiver;
public class AdminReceiver extends DeviceAdminReceiver {
}
Create device admin info XML file
Create a empty XML file inside ‘app/res/xml’ with ‘device-admin’ as root element. It should look like this:
<?xml version="1.0" encoding="utf-8"?>
<device-admin>
</device-admin>
Add device admin receiver to manifest
<receiver
android:name=".AdminReceiver"
android:label="@string/app_name"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data
android:name="android.app.device_admin"
android:resource="@xml/device_admin" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
</intent-filter>
</receiver>
Setup Boot Receiver
This class works as a receiver for Device boot events. We’ll make use of this to listen to the boot up event (after a restart and fresh start) to start our app in case it’s not already started.
Create boot receiver class by extending BroadcastReceiver
package com.example.myapp;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import java.util.Objects;
public class BootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (Objects.equals(intent.getAction(), Intent.ACTION_BOOT_COMPLETED)) {
Intent activityIntent = new Intent(context, MainActivity.class);
activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(activityIntent);
}
}
}
Add device admin receiver to manifest
<receiver android:enabled="true" android:exported="false" android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
android:name=".BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
Handle Back Press
We’ll override the back press method and keep the method body empty to prevent the user from closing the app.
Note: You can suppress the warning telling you to call the super method if it shows up, as we’re doing this intentionally.
@Override
public void onBackPressed() {
// Do nothing
}
Setup Immersive Mode
We’ll set the right window flags to make our app run in immersive mode. This hides status bar, navigation bar and other system UI.
private void setImmersiveMode() {
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_IMMERSIVE
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
);
}
Now when you install the app, perform these two steps in device settings:
- Set the app as default home app.
- Enable it as Device Admin.
And we’re done! You have now successfully made it hard for the user to exit or uninstall your app.
In case you’re feeling lazy, here is the entire code of the example shown in this article, with buttons to simulate crash and exit!
https://github.com/AjinkyaASK/Dedicated-Device-Using-Home-Screen-App
What’s next?
You can explore the other approaches mentioned in this article to create Dedicated Devices.
Let me know your questions and feedback by commenting below, I’ll try my best to answer them all.
Cheers!

