As of March 15, 2023, we will no longer sell Glass Enterprise Edition. We will continue supporting Glass Enterprise Edition until September 15, 2023. This documentation has been archived and remains as a historical reference for developers who actively maintain apps built for Glass Enterprise Edition. For more information, visit the Help Center.
Stay organized with collections
Save and categorize content based on your preferences.
Glass is typically configured to be used as a dedicated device with a small number of
applications that make up an enterprise solution. The following guide demonstrates how to set
up Glass as a dedicated device.
Provisioning
Low-touch provisioning
on Glass Enterprise Edition 2 installs and configures an admin application that's
downloaded from the metadata provided in a QR code. This application can take advantage of the
DevicePolicyManager
API, which is the preferred method to manage the device’s configuration.
Replace launcher
To set up a dedicated device, you must replace the launcher application. This ensures that the
dedicated application is launched automatically after the device reboots. The following content
outlines the tasks involved in preparing an application and setting it as the launcher:
To set a new launcher, call
addPersistentPreferredActivity() from the admin application. This only works if the device
has already been provisioned. For non-provisioned devices, select a new launcher from the UI on
the device.
Add persistent preferred activity
This method allows you to set a given componentName as the device’s launcher,
without interacting with the device.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-12-05 UTC."],[[["\u003cp\u003eThis guide explains how to set up Google Glass Enterprise Edition 2 as a dedicated device with a limited set of applications for enterprise solutions.\u003c/p\u003e\n"],["\u003cp\u003eDedicated device setup involves low-touch provisioning using QR codes and replacing the default launcher with your enterprise application.\u003c/p\u003e\n"],["\u003cp\u003eYou can set a persistent preferred activity for automatic launch after reboot and utilize lock task mode to restrict permitted apps.\u003c/p\u003e\n"],["\u003cp\u003eLock task mode can be started by the application's activity and allows control over which packages are permitted to run on the device.\u003c/p\u003e\n"]]],[],null,["Glass is typically configured to be used as a dedicated device with a small number of\napplications that make up an enterprise solution. The following guide demonstrates how to set\nup Glass as a dedicated device.\n| For more information, see [dedicated devices overview](https://developer.android.com/work/dpc/dedicated-devices) and [dedicated devices cookbook](https://developer.android.com/work/dpc/dedicated-devices/cookbook).\n\nProvisioning\n\n[Low-touch provisioning](/glass-enterprise/guides/provisioning-and-configuration)\non Glass Enterprise Edition 2 installs and configures an admin application that's\ndownloaded from the metadata provided in a QR code. This application can take advantage of the\n[DevicePolicyManager](https://developer.android.com/reference/android/app/admin/DevicePolicyManager)\nAPI, which is the preferred method to manage the device's configuration.\n\nReplace launcher\n\nTo set up a dedicated device, you must replace the launcher application. This ensures that the\ndedicated application is launched automatically after the device reboots. The following content\noutlines the tasks involved in preparing an application and setting it as the launcher:\n\n- [Activity intent filter](#activity-intent-filter)\n- [Set a new launcher](#set-a-new-launcher)\n\nActivity intent filter\n- You need to add the following categories to the main activity in your application's manifest: \n\n```text\n\u003cintent-filter\u003e\n \u003caction android:name=\"android.intent.action.MAIN\"/\u003e\n \u003ccategory android:name=\"android.intent.category.LAUNCHER\"/\u003e\n\n \u003ccategory android:name=\"android.intent.category.HOME\"/\u003e\n \u003ccategory android:name=\"android.intent.category.DEFAULT\"/\u003e\n\u003c/intent-filter\u003e\n```\n\nSet a new launcher\n- To set a new launcher, call [addPersistentPreferredActivity()](https://developer.android.com/reference/android/app/admin/DevicePolicyManager#addPersistentPreferredActivity(android.content.ComponentName,%20android.content.IntentFilter,%20android.content.ComponentName)) from the admin application. This only works if the device has already been provisioned. For non-provisioned devices, select a new launcher from the UI on the device.\n\nAdd persistent preferred activity\n- This method allows you to set a given `componentName` as the device's launcher, without interacting with the device. \n\nKotlin \n\n```kotlin\nval filter = IntentFilter(Intent.ACTION_MAIN)\nfilter.addCategory(Intent.CATEGORY_HOME)\nfilter.addCategory(Intent.CATEGORY_DEFAULT)\n\nval componentName = ComponentName(PACKAGE_NAME, CLASS_NAME)\nval devicePolicyManager: DevicePolicyManager =\n context.getSystemService(Context.DEVICE_POLICY_SERVICE) as DevicePolicyManager\nval adminName = getComponentName(context)\ndevicePolicyManager.addPersistentPreferredActivity(adminName, filter, componentName)\n```\n\nJava \n\n```java\nfinal IntentFilter filter = new IntentFilter(Intent.ACTION_MAIN);\nfilter.addCategory(Intent.CATEGORY_HOME);\nfilter.addCategory(Intent.CATEGORY_DEFAULT);\n\nfinal ComponentName componentName = new ComponentName(PACKAGE_NAME, CLASS_NAME);\nDevicePolicyManager devicePolicyManager =\n (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);\nfinal adminName = getComponentName(context);\ndevicePolicyManager.addPersistentPreferredActivity(adminName, filter, componentName);\n```\n| **Note:** Reboot the device to apply the changes.\n\nUse UI on the device\n- Use one of the following methods to show a launcher selection dialog on the screen:\n\nUsing swipe up touch gesture in settings\n- Swipe backwards on the home screen to show a settings summary screen. Then, tap to enter the settings screen. Swipe up to show the dialog.\n\nUsing intent in the application \n\nKotlin \n\n```kotlin\nval intent = Intent(Intent.ACTION_MAIN);\nintent.addCategory(Intent.CATEGORY_HOME);\nstartActivity(intent);\n```\n\nJava \n\n```java\nfinal Intent intent = new Intent(Intent.ACTION_MAIN);\nintent.addCategory(Intent.CATEGORY_HOME);\nstartActivity(intent);\n```\n\nUsing adb command\n- `adb shell am start -a android.intent.action.MAIN -c android.intent.category.HOME`\n- Swipe forward and backward on the touchpad to select your preferred application and tap to confirm. Use the same method to select the \"Always\" button.\n\nLock task mode\n- Lock task mode allows you to create a list of packages that are permitted to run on the device.\n| For more information, see [lock task mode overview](https://developer.android.com/work/dpc/dedicated-devices/lock-task-mode).\n\nSet permitted packages\n- The following snippet shows you how to set the list of packages: \n\nKotlin \n\n```kotlin\nprivate val KIOSK_PACKAGE = \"com.example.kiosk\"\nprivate val PLAYER_PACKAGE = \"com.example.player\"\nprivate val APP_PACKAGES = arrayOf(KIOSK_PACKAGE, PLAYER_PACKAGE)\n\nval devicePolicyManager: DevicePolicyManager =\n context.getSystemService(Context.DEVICE_POLICY_SERVICE) as DevicePolicyManager\nval adminName = getComponentName(context)\ndevicePolicyManager.setLockTaskPackages(adminName, APP_PACKAGES)\n```\n\nJava \n\n```java\nprivate static final String KIOSK_PACKAGE = \"com.example.kiosk\";\nprivate static final String PLAYER_PACKAGE = \"com.example.player\";\nprivate static final String[] APP_PACKAGES = {KIOSK_PACKAGE, PLAYER_PACKAGE};\n\nfinal DevicePolicyManager devicePolicyManager =\n (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);\nfinal ComponentName adminName = getComponentName(context);\ndevicePolicyManager.setLockTaskPackages(adminName, APP_PACKAGES);\n```\n| **Note:** If you want to allow users to control the [settings](/glass-enterprise/guides/application-integration#settings) on Glass be sure to add the `com.google.android.glass.settings` package to the list.\n| **Note:** If the application's package isn't on the lock task packages list, [screen pinning](https://support.google.com/android/answer/9455138) is launched instead.\n\nStart lock task mode\n- Lock task mode can be started by the application's activity. The following snippet shows how you can do this: \n\nKotlin \n\n```kotlin\noverride fun onResume() {\n super.onResume()\n activity.startLockTask()\n}\n```\n\nJava \n\n```java\n@Override\npublic void onResume() {\n super.onResume();\n getActivity().startLockTask();\n}\n```"]]