45

My company is looking at selling an Android device with an application on that will do a certain task as a product to replace an embedded device.

However we need to some how lock the device to only have access to our application which we will develop and not be able to access the normal Android OS interface.

I would like the following:

  1. When the device boots it must automatically load our application
  2. There must be no way to exit the application, (unless if we maybe enter a master password) which will allows you access to the device

Is this possible to do, and how would one go about doing this?

wonea
  • 4,783
  • 17
  • 86
  • 139
Zapnologica
  • 22,170
  • 44
  • 158
  • 253
  • 1
    You most likely will have to use the NDK to create your own kernel and modify it for your purposes. I am not sure if it is possible through just the SDK. – Social_Engineerer Jun 09 '14 at 20:04
  • 1
    For obvious reasons, this is not natively possible through the Android SDK… but you can get away with it if you seek custom roms and/or modify and create your own Android. It would come handy in some companies, but afaik, there's no support for that yet. – Martin Marconcini Jun 09 '14 at 20:07
  • possible duplicate of [Kiosk mode in Android](http://stackoverflow.com/questions/2068084/kiosk-mode-in-android) – Daniel Jun 09 '14 at 20:51
  • Is it possible to build your own ROM for any device? My Understanding of the matter is that, you need to find a kernel for your specific device first. Then you can build from there? Or am I mistaken – Zapnologica Jun 10 '14 at 06:11
  • Daniel's answer is mostly correct. With newer Android versions Google has started making this functionality available. I outline COSU/Lock-task mode as well as some other ways to create a single-use device in my answer to a similar question here: https://stackoverflow.com/a/43644803/2888763 – Trevor Halvorson May 22 '17 at 17:41

5 Answers5

32

Lollipop (5.0) supports the concept of screen pinning, which is what I think you're after.

Android 5.0 introduces a new screen pinning API that lets you temporarily restrict users from leaving your task or being interrupted by notifications. This could be used, for example, if you are developing an education app to support high stakes assessment requirements on Android, or a single-purpose or kiosk application. Once your app activates screen pinning, users cannot see notifications, access other apps, or return to the home screen, until your app exits the mode.

There are two ways to activate screen pinning:

Manually: Users can enable screen pinning in Settings > Security > Screen Pinning, and select the tasks they want to pin by touching the green pin icon in the recents screen.

Programmatically: To activate screen pinning programmatically, call startLockTask() from your app. If the requesting app is not a device owner, the user is prompted for confirmation. A device owner app can call the setLockTaskPackages() method to enable apps to be pinnable without the user confirmation step.

https://developer.android.com/about/versions/android-5.0.html

Community
  • 1
  • 1
Mark Melling
  • 1,562
  • 14
  • 15
  • 3
    Looks like [screen pinning disables on a reboot](https://community.spiceworks.com/topic/814707-does-android-screen-pinning-continue-after-reboot). – Chris Jun 07 '16 at 20:32
23

There are several different possible solutions for this problem which are mentioned below, but there is no "out of the box" solution implemented in Android. (Edit: At least not before Android 5.0)

  • Develop your application and activate it as standard Home Screen App/ Launcher. Users could only avoid this solution by booting in safe mode.
  • Develop your own kernel (as mentioned by Chloe at the comments)
  • Use a 3rd party application for this case. (This will mostly require root on your device) Different solutions are available at the Play Store (e.g. KioWare or SureLock). Search for Android Kiosk Mode to get more results.
wonea
  • 4,783
  • 17
  • 86
  • 139
Daniel
  • 3,541
  • 3
  • 33
  • 46
  • 3
    Thanks for the feed back, I am glad there are several options, Especially ones that might not involve building the kernel, as I dont think the devices supplier is willing to give us their kernel. – Zapnologica Jun 10 '14 at 06:10
  • developing as a launcher is interesting idea. What do you think about if user needs to open settings? I can't see a way? I need to develop an app that should work like a kiosk app, but user can be edit device's network settings. – atasoyh Feb 15 '17 at 09:26
12

Starting Android 6.0, you can configure device policies for Corporate Owned Single Use (COSU) devices, which is an addition to what @Mark Melling pointed out.

As an IT administrator, you can configure Android 6.0 Marshmallow and later devices as corporate-owned, single-use (COSU) devices. These are Android devices used for a single purpose, such as digital signage, ticket printing, point of sale, or inventory management. To use Android devices as COSU devices, you need to develop Android apps that your customers can manage.

Your customers can configure COSU devices:

To lock a single application to the screen, and hide the Home and Recents buttons to prevent users from escaping the app. To allow multiple applications to appear on the screen, such as a library kiosk with a catalog app and web browser.

http://developer.android.com/training/enterprise/cosu.html

SoroushA
  • 2,043
  • 1
  • 13
  • 29
  • 3
    This is another interesting solution, but as far as I understand, the procedure is quite articulated: there has to be an EMM provider, registered in the community, etc. etc. i.e. no simple way for small app developers to give "the windows-ce device feel" to a lot of other small businesses. Hope I'm misunderstood... Or that the whole thing gets simplified with future updates. – Alex Mazzariol Jul 28 '17 at 08:36
  • 1
    @AlexMazzariol An EMM provider is not necessary. I've been working on a COSU app that we provision through a QR code to load our app as Device Owner. This gives us the ability to pin the app and prevent people from escaping into other apps. We also wrote our own Launcher to replace the default launcher in case our App crashes (it has our logo and only a button to launch our app). – Stephen M -on strike- Jan 28 '19 at 22:29
  • 1
    @StephenM yes, I did realize that much since I left my comment, but forgot to update it - it's been more than a year and half... It should be noted that both QR-code-provisioned and EMM-provisioned COSU devices must be set up just after reset (or at the first boot). – Alex Mazzariol Jan 30 '19 at 10:24
4

Google recently released the Android Management API which allows to easily manage Android devices, lock them on a single application and set various other policies.

Fred
  • 2,191
  • 1
  • 12
  • 14
2

Try MobiLock Pro, It helps you to turn down your Android device into kiosk mode by allowing only single app to run on the device all the time. It restricts user from accessing the home screen in Single app kiosk mode. Rebooting the device wouldn’t exit the Single App kiosk mode as it continues to work after the reboot.

David_131
  • 21
  • 2