Streamlining Workstation Connect Configuration: A Step-by-Step Guide for Developers
Foreword
This blog is an annex to the Zebra Workstation Connect User Guide for Developers (wsc-dev-ug.pdf) and is published at the following address https://developer.zebra.com/blog/streamlining-workstation-connect-configuration-step-step-guide-developers
It aims to support developers with a few annotated sample projects
- https://github.com/ZebraDevs/WSC-DEV-UG-SampleApp (Java)
- https://github.com/ZebraDevs/WSC-MAUI-SampleApp (.NET MAUI, C#)
- https://github.com/ZebraDevs/WSC-FLUTTER-SampleApp (Flutter, Dart/Java)
A more thorough introduction to Zebra Workstation Connect (acronyms: ZWC or WSC) is found in the Zebra DevCon 2023 archive. For slides and videos, visit
Workstation Connect (WSC) pre-requisites
At the time of writing, WSC 2.0 is publicly available. Such version is only supported on Android 11, on Zebra devices that have installed a minimum LifeGuard Update version (see next table)
Starred (*) models additionally require the Mobility DNA Enterprise License.
Get the WSC launcher from https://www.zebra.com/us/en/support-downloads/software/productivity-apps/workstation-connect.html
Programmatically configuring WSC
WSC gets configured using a JSON configuration file, which holds all the restrictions to be applied.
This is an example of a JSON Configuration file
In the example above, the feature with value=1 gets enabled, and those with value=2 get disabled.
Here you can compare the original launcher (left) and how the launcher appears after the configuration is applied (right)
The All apps button is disabled, and the apps running on the mobile display are not listed
Developers have two options to transfer the configuration to WSC: via a Delegation Scope and Secure Storage Manager (SSM).
Using Delegation Scopes to configure WSC
-
The delegation scope to use is
delegation-zebra-workstation connect-api-access-configuration-service
-
Your Administrator needs to permit your application to call the service associated with that delegation scope. To do so, the following MX feature must be used, e.g. via Stagenow
-
The Service Identifier is the delegation scope name as shared above
-
The Caller Package Name is your
applicationID
as it appears the in module's gradle.build file -
The Caller Signature is your app's public signature. You can extract it e.g. with https://techdocs.zebra.com/emdk-for-android/latest/samples/sigtools/
On the coding side,
-
add the following AIDL to your project, keeping the name and package name unchanged (GitHub reference)
-
then implement a
ServiceConnection
interface and in theonServiceConnected
get an instance of the service binderiServiceBinder = com.zebra.valueadd.IZVAService.Stub.asInterface(service);
-
in the
onStart
method you can finally bind the WSC service by calling (Github reference)private void bindtoZVAService() { Intent intent = new Intent("com.zebra.workstationconnect.release"); intent.setClassName("com.zebra.workstationconnect.release", "com.zebra.workstationconnect.DeviceManagementService"); bindService(intent, this, BIND_AUTO_CREATE); }
-
eventually, the configuration gets transferred to the equipment by calling one single API (See here)
iServiceBinder.processZVARequest( JSON Configuration string )
Using Secure Storage Manager (SSM) to configure WSC
This method is described in the WSC Administrator's Guide, on page 46 https://www.zebra.com/content/dam/zebra_new_ia/en-us/manuals/software/workstation-connect/wsc-ag-en.pdf
- Create the desired configuration as a JSON string
- Persist it as a file in a folder that can be accessed by any apps
- Feed the file to SSM using this target URI
com.zebra.workstationconnect.release/enterprise/workstation_connect_config.txt
To learn how SSM works with files, refer to https://techdocs.zebra.com/ssm/1-1/guide/share-files/
Working with Desktop Shortcuts
To dynamically manage the apps' shortcuts that appear on the secondary launcher, do the following
-
manually create a set of shortcuts and export them by right-clicking the mouse on the launcher free space. Shortcuts get exported in the
/enterprise/usr/Export_Shortcuts_DATE-TIME.txt
file. The shortcuts are persisted as JSON values. -
in the Config.json file use the
shortcutImportFile
API, which is part of theconfigDesktopShortcuts
key -
as a value, pass the exported shortcuts
- be mindful to escape with a backslash
\
the imported JSON shortcuts
-
you can drop the
checksum
key if you edit the shortcuts since this field is optional
- be mindful to escape with a backslash
Techdocs Documentation and Roadmap
-
Workstation Connect is also documented here https://techdocs.zebra.com/zwc/2-0/about/
-
For Enterprise Browser APIs, refer to https://techdocs.zebra.com/enterprise-browser/latest/guide/zwc/#apisforzwc
-
WSC v3 will be made available in March 2024 and support for Android 13 is added!
Nicola De Zolt
.