Technical Guide

Configuration key-value pairs applicable to custom intents.

Device Events

The following device states/events are available as triggers in the launcher.json's base-level object "intents". Multiple intent objects can be listed sequentially in each device event's array.

Field
Description

preLogin

array A collection of Custom Intents to invoke before the authentication process begins.

login

array A collection of Custom Intents to invoke after user logs into the device.

logout

array A collection of Custom Intents to invoke after user logs out of the device, prior to launcher completing full logout.

postLogout

array A collection of Custom Intents to invoke after user logs out of the device. This occurs after all Logout actions are completed.

boot

array A collection of Custom Intents to invoke after device boot.

uncradle

array A collection of Custom Intents to invoke after the device is removed from the cradle.

cradle

array A collection of Custom Intents to invoke after the device is placed on the cradle.

screenOn

array A collection of Custom Intents to invoke after the screen turns on.

motionLockEnter

array A collection of custom intents to invoke when lockInMotion engages on the device.

motionLockExit

array A collection of custom intents to invoke when the device exits from lockInMotion state.

siteChange

array A collection of custom intents to invoke when a site change is detected.

Key-Value Pairs

The following key-value pairs are used to build each custom intent object:

Key
Value Description

package

string The package to invoke.

action

string Android action, or special Platform Action.

category

string Android Category.

class

string The Class name within the package.

flags

integer Flags to use during firing the intent. Currently supports the value of 1, which indicates new task.

typeIntent

string The type of intent, values b, i, a, d or p. b = Broadcast (default), i = implicit intent, a = start Activity, d = delay, p = platform.

extras

Hash Map Key/value pairs of additional data to send. Example:

data

string Data to send with the intent.

filter

object Object for defining which key-value pair of the session object will trigger the intent. Example:

Examples

All Device Event Arrays

Below is an example where each device event array is present. The following example performs the following:

  1. After login, the Launcher home screen will rotate to Landscape orientation

  2. During logout:

    1. Launcher clears the cache of Android Chrome

    2. The Launcher home screen will rotate back to Portrait orientation

  3. In addition, whenever the device is removed from the cradle:

    1. The device volume will be adjusted to 100%

"intents": {
    "preLogin": [],
    "login": [
        {
            "action": "com.bluefletch.launcher.ACTION_ROTATE_LANDSCAPE",
            "typeIntent": "p"
        }
    ],
    "logout":[
        {
            "action": "CLEARCACHE",
            "package": "com.android.chrome",
            "typeIntent": "p"
        },
        {
            "action": "com.bluefletch.launcher.ACTION_ROTATE_PORTRAIT",
            "typeIntent": "p"
        }
    ],
    "postLogout": [],
    "boot": [],
    "uncradle": [
        {
            "action": "ADJUST_AUDIO",
            "typeIntent": "p",
            "extras": {
                "others": 100
            }
        }
    ],
    "cradle": [],
    "screenOn": [],
    "motionLockEnter": [],
    "motionLockExit": [],
    "siteChange": []
  }

Unused arrays may or may not be included in the "intents" object for the existing intents to work; empty arrays do not cause issues but they are also not required to be included.

Dynamic Time Zones

This specific intent example is a potential solution to the problem of automatically assigning time zones to devices, especially in non-uniform time zones such the US state of Arizona. The following example requires adding a siteTimeZone column to the sitelist.csv file deployed to devices, which creates a custom extended attribute named siteTimeZone. The intents also trigger StageNow XMLs via Launcher's XML platform action, so this example is only applicable to Zebra devices.

The example below performs the following:

  1. When the device's site changes because the device is in a new location

    1. If the device's current site is associated in the sitelist.csv file with the extended attribute "siteTimeZone": "Eastern", then a StageNow XML to set the device to Eastern time will be triggered.

    2. If the device's current site is associated in the sitelist.csv file with the extended attribute "siteTimeZone": "Central", then a StageNow XML to set the device to Central time will be triggered.

    3. If the device's current site is associated in the sitelist.csv file with the extended attribute "siteTimeZone": "Mountain", then a StageNow XML to set the device to Mountain time will be triggered.

    4. If the device's current site is associated in the sitelist.csv file with the extended attribute "siteTimeZone": "Arizona", then a StageNow XML to set the device to Arizona time will be triggered.

    5. If the device's current site is associated in the sitelist.csv file with the extended attribute "siteTimeZone": "Pacific", then a StageNow XML to set the device to Pacific time will be triggered.

"intents": {        
    "siteChange": [
        {
            "action": "XML",
            "typeIntent": "p",
            "data": "/sdcard/Download/ems/Set-Eastern-Timezone.xml",
            "criteria_OR": [
                {
                    "field": "${config.ex.siteTimeZone}",
                    "pattern": "Eastern"
                }
            ]
        },
        {
            "action": "XML",
            "typeIntent": "p",
            "data": "/sdcard/Download/ems/Set-Central-Timezone.xml",
            "criteria_OR": [
                {
                    "field": "${config.ex.siteTimeZone}",
                    "pattern": "Central"
                }
            ]
        },
        {
            "action": "XML",
            "typeIntent": "p",
            "data": "/sdcard/Download/ems/Set-Mountain-Timezone.xml",
            "criteria_OR": [
                {
                    "field": "${config.ex.siteTimeZone}",
                    "pattern": "Mountain"
                }
            ]
        },
        {
            "action": "XML",
            "typeIntent": "p",
            "data": "/sdcard/Download/ems/Set-Arizona-Timezone.xml",
            "criteria_OR": [
                {
                    "field": "${config.ex.siteTimeZone}",
                    "pattern": "Arizona"
                }
            ]
        },
        {
            "action": "XML",
            "typeIntent": "p",
            "data": "/sdcard/Download/ems/Set-Pacific-Timezone.xml",
            "criteria_OR": [
                {
                    "field": "${config.ex.siteTimeZone}",
                    "pattern": "Pacific"
                }
            ]
        }
    ]
}

Last updated