Glass EE2 is conceived mainly as a single purpose tool for Enterprise. In most cases, partners
develop their own experiences, which include a launcher or kiosk mode app that takes over from
the moment Glass boots up.

## Launcher

Glass comes with a launcher and a settings app.

### Add an application to the launcher

In order to show your application on the launcher application list, you need to add
`com.google.android.glass.category.DIRECTORY` to the main activity in your
application's manifest:

```
<activity
    android:name="com.example.android.glass.cardsample.MainActivity">
    <intent-filter>
        <action
            android:name="android.intent.action.MAIN" />
        <category
            android:name="android.intent.category.LAUNCHER" />
        <category
            android:name="com.google.android.glass.category.DIRECTORY" />
    </intent-filter>
</activity>
```

## Settings

The Glass Settings app allows users to check the battery level, connect to Wi-Fi and Bluetooth,
modify the volume and brightness, factory reset, and to check the firmware version, serial number
and free storage space of the device.

### Wi-Fi settings

When you connect to a Wi-Fi network with a password, you must use a QR code that should comply
with Wi-Fi network configs.

One easy way to generate the Wi-Fi code is to use a generator such as
[QiFi](https://qifi.org/).

### Settings intents

Applications can use intents to take advantage of the Glass Settings UI.

#### Launch settings

To launch the Glass Settings app, start it as any other Android activity:

```
adb shell am start -n com.google.android.glass.settings/.MainActivity
```

#### Settings pages

To launch a specific page in Settings, Glass supports the following actions:

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.BATTERY_SETTINGS
```

<br />

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.WIFI_SETTINGS
```

<br />

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.BLUETOOTH_SETTINGS
```

<br />

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.VOLUME_SETTINGS
```

<br />

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.BRIGHTNESS_SETTINGS
```

<br />

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.DEVICE_INFO_SETTINGS
```

<br />

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.SHOW_REGULATORY_INFO
```

<br />

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.SYSTEM_SETTINGS
```

<br />

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.DATE_SETTINGS
```

<br />

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.LOCALE_SETTINGS
```

<br />

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.INPUT_METHOD_SETTINGS
```

<br />

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.DEVELOPMENT_SETTINGS
```

<br />

<br />

```
adb shell am start -n com.google.android.glass.settings/.MainActivity -a android.settings.FACTORY_RESET_SETTINGS
```

<br />

### User restrictions

To make sure devices are used as intended, enable user restrictions on settings.

The following snippet shows how you can set the restrictions:

### Kotlin

```kotlin
val devicePolicyManager: DevicePolicyManager =
    context.getSystemService(Context.DEVICE_POLICY_SERVICE) as DevicePolicyManager
val adminName = getComponentName(context)

arrayOf(
  UserManager.DISALLOW_CONFIG_WIFI,
  UserManager.DISALLOW_CONFIG_BLUETOOTH,
  UserManager.DISALLOW_FACTORY_RESET
).forEach { devicePolicyManager.addUserRestriction(adminName, it) }
```

### Java

```java
String[] restrictions = {
  UserManager.DISALLOW_CONFIG_WIFI,
  UserManager.DISALLOW_CONFIG_BLUETOOTH,
  UserManager.DISALLOW_FACTORY_RESET};

final DevicePolicyManager devicePolicyManager =
    (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
final adminName = getComponentName(context);

for (String restriction: restrictions) {
  devicePolicyManager.addUserRestriction(adminName, restriction);
}
```

The following is a list of available user restrictions:

- `https://developer.android.com/reference/android/os/UserManager#DISALLOW_CONFIG_WIFI`
- `https://developer.android.com/reference/android/os/UserManager#DISALLOW_CONFIG_BLUETOOTH`
- `https://developer.android.com/reference/android/os/UserManager#DISALLOW_ADJUST_VOLUME`
- `https://developer.android.com/reference/android/os/UserManager#DISALLOW_DEBUGGING_FEATURES`
- `https://developer.android.com/reference/android/os/UserManager#DISALLOW_FACTORY_RESET`

### Hinge auto shutdown timeout

When you close the hinge and the device isn't connected to any power source, it shuts down after four hours of inactivity. To change this behavior, Glass supports the following actions:

#### Disable auto shutdown

```
adb shell am start \
-a com.google.android.glass.settings.mcu.HINGE_SHUTDOWN_TIMEOUT_ACTION \
--ei com.google.android.glass.settings.mcu.HINGE_SHUTDOWN_TIMEOUT -1
```

#### Immediate auto shutdown

```
adb shell am start \
-a com.google.android.glass.settings.mcu.HINGE_SHUTDOWN_TIMEOUT_ACTION \
--ei com.google.android.glass.settings.mcu.HINGE_SHUTDOWN_TIMEOUT 0
```

#### Auto shutdown after a specified time

```
adb shell am start \
-a com.google.android.glass.settings.mcu.HINGE_SHUTDOWN_TIMEOUT_ACTION \
--ei com.google.android.glass.settings.mcu.HINGE_SHUTDOWN_TIMEOUT time_in_minutes
```

## Install applications

To install an application on Glass, do the following:

1. Download [Android Debug Bridge](https://developer.android.com/studio/command-line/adb) on your computer.
2. Use the command line terminal on your computer to add the downloaded `platform-tools` directory to the system `PATH` variable:
   - Windows

   ```
   set PATH=%PATH%;C:\path\to\platform-tools
   ```
   - Linux and MacOS

   ```
   echo "export PATH=\$PATH:/path/to/platform-tools" >> ~/.bash_profile && source ~/.bash_profile
   ```
3. Download the APK file to your computer from your solution provider.
4. Connect Glass to the computer with a USB cable.
5. If a prompt appears on the screen, tap to allow USB debugging on Glass.
6. Open a command line terminal on your computer.
7. Follow the [adb instructions](https://developer.android.com/studio/command-line/adb#move) to install the APK.

**Note:** To reinstall the application, use the` adb install -r path_to_file ` command.