In our previous blogs we talked about what a kiosk is and how these devices are surging in popularity today. We have also discussed some of the key strategies for kiosks 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. It will be more technical in nature but we hope that this will inspire you to implement a dedicated kiosk build strategy.
A Quick Pulse-check: What’s The Purpose Of A Kiosk?
When it comes to kiosks, a 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 locks down the system and gives you the option to choose your settings – like disabling the lock screen via stock-settings. 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.
In the next section we 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 enable the following types of apps 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
Pros and cons of each application
|Feature||Google Play For Work 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 Web Apps
You can easily enroll your Esper Endpoint in Google’s managed Play Store via Esper Console – see our docs for how to do this. This gives Esper customers the ability to leverage the Play Store they know and love for certain use cases. A requirement is your device is GMS certified, supporting Playstore. Play Store itself has the ability to generate Web Apps. Here’s how you can do that with Esper Console after you’ve enrolled in managed Google Play.
1. From Esper Console, click on Apps and then Google Play.
2. Play Store 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 visible on a browser opened 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! (If you need to use http this option will not work for you, and your best path is to create a traditional Android app.) Lastly, create a 512px x 512px icon to use with your app and click Save.
5. Within a few minutes (it can be up to 30 minutes depending on how Google handles their queue), Google will create a special Web App for you and make it available via the Play Store (only visible to you!). Can’t find it on your Play Store? 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:
Pro-tip: Select “Keep approved when app requires new permission” option to auto-approve new app changes (e.g. change in title, icon, or URL). Click Save. This app will be available to deploy 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.
- Purpose of the kiosk is to operate applications that “run in Kiosk mode.” Since Android is a fragmented ecosystem with lots of moving parts, there are plenty of options on how to implement apps in Kiosk mode.
- 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
Until now, 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.