The Best Way To Build Android Apps In Kiosk Mode Using Esper
We have already talked about what a kiosk is and how these devices are surging in popularity today – appearing everywhere within the retail industry but also expanding rapidly into many other verticals. We also described some of the key strategies for defining a kiosk experience that will keep customers coming back to your brand, product, or service every time.
In this blog, let’s dig deeper into the nuts and bolts of how to actually build Android apps in Kiosk mode. This topic will understandably be more technical in nature and scope but we hope that it will inspire you to get started on implementing a dedicated kiosk build strategy.
A Quick Pulse-check: What’s The Purpose Of A Kiosk?
When it comes to kiosks, question may arise: What does a kiosk do? A kiosk can take many form factors ranging from stand-up units to simple tablets mounted on a counter. For the sake of simplicity, let’s assume: a kiosk is a dedicated device that is locked down and focused on completing a specific set of pre-arranged tasks. It may be used for gathering customer feedback, for selecting food items, or for checking into a flight.
Let’s get more technical; the purpose of the kiosk is to operate applications that “run in Kiosk mode.” Back to the points outlined above, these apps “lockdown” the system in such a way that only the permitted application is displayed to the user on the display at any given time.
In other words, the user may interact with the app, but not be able to move away from the app and interact with the underlying operating system, which means you want to keep a precocious user from turning the local insurance agent’s kiosk into a Fortnite playstation.
Key Prep For Operating In Kiosk Mode
The process of preparing your device to operate in Kiosk mode is all about properly deploying and provisioning the OS of the device on which it will run. This acknowledges the fact that the Android ecosystem is extremely fragmented; which is why a kiosk roll-out strategy is never done in isolation but encompasses a range of designated roles from development & testing to those responsible for managing device images, updates, signing images, etc.
7 things to keep in mind while creating a Kiosk-mode app on an unmanaged Android device
- Make your app a DeviceAdminReceiver, giving it requisite permissions.
- Use adb to make your app a device-admin.
- Set up your app to be the default application (launcher) so that it comes up as soon as the Android device is booted.
- Disable the lock screen so that it doesn’t show up when the device boots up.
- Then in the core logic of your app, ensure that you let the DevicePolicyManager know that you intend the screen to be ON.
- Prevent hardware buttons like the volume buttons (if your Kiosk exposes these) to modify any settings.
- And finally, ensure that your app can go full-screen.
There are tons of tutorials (here, and here for instance) that describe how to turn an Android app into a kiosk, along with a lot of open-source projects that you can refer to for creating your Kiosk-mode app.
Create Kiosk-Mode Apps For Use With Esper
The above seems a little daunting at first for someone trying to create a new application and deploy it effortlessly to a large fleet of devices. Devoting engineering resources (and committing them to maintenance) for common plumbing work may not be the best approach for innovation and agility. This is where Esper comes in! With Esper, most of the requirements listed above for a Kiosk mode app are simply eliminated, and you are left with focusing on writing the core logic of your app.
For instance, Esper’s Device Agent already takes care of locking down the system and gives you the convenience of choosing your settings – like disabling the lock screen via stock-settings – through Esper’s templates. Furthermore, this paves the way for you to write simple Progressive Web Apps that can run in Kiosk-mode on Esper-administered Kiosks.
This means that you can literally create Kiosk apps within a minute with zero Android coding involved! What’s more, updates to these apps can happen within seconds, since the logic is all in the backend.
The following section will walk you through the creation of several Kiosk-mode apps along with some very cool tricks you can use to maximize revenue via your own customized applications.
Steps To Create Android Kiosk Mode Apps Using Esper
Esper enables the following types of apps to be used as Kiosk mode applications:
- Web-Based Apps (the app wraps a website in itself):
- Traditional Android Apps
- Traditional Android Apps utilizing the Esper Device SDK
Let’s look at the pros and cons of each application
|Feature||Google Play For Work Progressive Web Apps||Apps Utilizing Google Chrome Trusted Web Activities||Apps that utilize a WebView||Traditional Android Apps||Traditional Android Apps utilizing the Esper Device SDK|
|Auto-generation of App via Console||Yes|
|Identify Interaction to Machine||No||No||Yes||No||Yes|
(if Chrome not present, default browser will be used)
|Screen Pinning Support||No||No||Yes||Yes||Yes|
|True Full Screen (no Navigation bar)||No||No||No||No||Yes|
Let’s look at each of these in detail:
Google Play For Work Progressive Web Apps
Anyone can enroll in Google’s PlayStore support via Esper Console. This gives Esper customers the ability to leverage the PlayStore they know and love. PlayStore itself has the ability to generate Progressive Web Apps. Here’s how you can do that with Esper Console.
1. From Esper Console, click on Play for Work:
2. PlayStore content shows up in your console window. Move your mouse over the icons on the left to see a link called Web apps. Click on it
3. On the next screen, you can create a new Progressive app by clicking on the small “plus” icons that show up in the right bottom of the page
4. This will show a screen that allows you to enter the Title, URL, and an icon for your app
The URL is what will be loaded into your app, so make sure that the contents of the URL is properly visible on a browser opened up on your kiosk. Don’t forget to give a URL with https (as opposed to http), since Chrome will not show your app in full screen! Lastly, create a 512px x 512px icon to use with your app and click Save.
5. Within a few minutes, Google will create a special Web App for you and make it available via the PlayStore (only visible to you!). Can’t find it on your PlayStore? Click on the Search PlayStore icon, and type the title of the app you just created and click on Search.
6. Click on the app, and then click on the Approve button:
7. In the resulting Window, click on Approve again:
8. Pro -tip: Select the option to keep the app approved through changes, so that newer app-variations will be auto-approved (e.g. if you change the title, icon, or URL in the future, they will be auto-approved). Click Save. This app will now be available to be deployed to the devices in your fleet.
Apps utilizing Google Chrome Trusted Web Activities
Google’s tutorial on writing a Trusted Web Activity is very good, and we’d recommend you follow it to create an app similar in scope. Once you have it, you can simply upload it to the Apps’ section of the console, like any other app, and deploy it to your fleet.
One thing to keep in mind here is that Trusted Web Activities need a special file called assetlinks.json within a /.well-known folder. Sites like netlify “swallow” the well-known folder when you deploy to your site via folder-copy. It works fine if you do so via other mechanisms they support.
Also, another thing to note is that you should not use a URL where the /.well-known folder is present while created Progressive Web Apps from PFW are shown in the previous section. Your site will not show up in full-screen in Chrome.
Apps that utilize a WebView
There are several open-source projects that can be referenced to do this. It’s best to refer to them.
Traditional Android Apps utilizing the Esper Device SDK
Here is a sample Application that you can use to create a Kiosk Mode app on Esper Device SDK. It is a great way to use it as a starting point for your app.
- We agreed from the outset that the purpose of the kiosk is to operate applications that “run in Kiosk mode.” But we also noted that since Android does tend to be a very fragmented ecosystem with lots of moving parts, there are plenty of options on how to implement apps in Kiosk mode.
- We discussed guidelines on how to use Esper to build your Android apps in Kiosk mode. The three major approaches are:
- Web-based Apps
- Traditional Android Apps
- Traditional Android Apps utilizing the Esper Device SDK
Now that we’ve discussed how to use the Esper platform to create Android Apps for your kiosk, in the next blog let’s explore on how to actually manage that kiosk: Using Esper to Manage Your Kiosk Strategy.
If you want to reach out to us directly, write to email@example.com.