How to: Delete or disable a Visual Formatter package via Intents

In the article How to: Install a Visual Formatter project (Scan2Deploy, Manually, Intent) we have provided information on how to untether the installation of individual Visual Formatter packages from the use of Scan2Deploy, such as to deploy only a Visual Fomratter project via an EMM, by copying the package to the device and using an intent.

A similar need that may arise is to remove or disable a Visual Formatter package previously installed on a device.

Unfortunately the “com.datalogic.decode.visualformatter.INSTALL” intent actions described in the article above was made for integration purpose with Scan2Deploy only, and a corresponding “.UNINSTALL” or “.REMOVEALL” command does not exists.

However, for the specified use case we can leverage on a couple of options:

The first option is based on the fact that whenever you install a Visual Formatter script with a new script with the same name, the script already installed on the device is always overwritten.
This means that if you know the name of the V.F. script installed on the device, you can overwrite it with a new script “that does nothing” to solve the problem.

The second option is more clean.
When you manually install a V.F. script with an intent, you have the extra:

<--ez "enable" true>

that forces the device to activate the installing script and disable all the other previously installed scripts (formatters or dispatchers).

Instead of “true”, you can use the extra:

<--ez "enable" false>

to re-install one of the existing scripts, or a brad new script, to force the system to disable all the previously installed scripts but also the one being installed.
As a result the system will have one ore more script actually installed, but none of them will be active and also the DL Setting menu UI for the Visual Formatter items list will be grayed as if empty.

This ADB command line installs a V.F. project exported as “” and disable it as well as all the other scripts on the device:

adb shell am broadcast -n com.datalogic.service/com.datalogic.provider.VisualFormatterInstallReceiver" -a "com.datalogic.decode.visualformatter.INSTALL" --ez "enable" false --es "install_path" "/sdcard/"

This is what you will see on the DLSettings menu:

This method can be easily used in the case of devices managed via different EMMs.
The following example shows how to install as disabled a V.F. project via SOTI scripts and consequently also disable any other scripts that may already be on the device:

sendintent -b "intent:#Intent;component=com.datalogic.service/com.datalogic.provider.VisualFormatterInstallReceiver;action=com.datalogic.decode.visualformatter.INSTALL;B.enable=false;S.install_path=/sdcard/;end"

Simone Callegari
Datalogic Mobile Products Specialist - SW Engineer

1 Like