How to: Use in different tools (ADB, MDMs, OEMConfig and SDK) an Intent that applies a Scan2Deploy configuration

This article wants to show how the Intent that applies a S2D configuration can be used by different tools (ADB, MDMs, OEMConfig e SDK). The Intent starts ScanToDeploy and applies the configuration passed in the extra.

Let’s create an S2D configuration to use as an example ( more information Device and Scanner Settings Page | Technical Documentation ).

In this example I have changed the “Suspend on external power”= 10 minutes and “Suspend on internal power” = 10 minutes

In the last step you can copy the “Copy encrypted Data” (more information https://datalogic.github.io/scan2deploy/save-and-print-page ).


And pass the encrypted data to the Intent.

Starting from ScanToDeploy version 2.0.0 is it possible to copy the Intent directly from the section “Save & Scan” for the EMM listed (Save and Scan Page | Technical Documentation):

There are two different Intents available:

  1. A start service Intent (https://datalogic.github.io/scan2deploy/save-and-print-page/#start-service-intent)
    Detail of the Service Intent:


    (table from https://datalogic.github.io/scan2deploy/save-and-print-page/#extras )
    The Intent starts the S2D Service behind the scenes, meanwhile the service is running, according with the Android version, an icon could be showed in the tab bar, for example in A11 you will see:
    image

  2. The “classic” Start Activity Intent (https://datalogic.github.io/scan2deploy/save-and-print-page/#start-activity-intent ) on which is possible to pass the extras “encoding” and “data” like the service intent (see the ADB example).

Following, it will be shown how to send the Intent from different tools and how to apply the configuration of S2D previously saved as “Copy encrypted Data” and passed with encoding “v2”.
The prerequisites for running these examples are that OEM and S2D Agent are already installed and updated on the device (currently S2D agent should be at least at ver. 1.33 and about OEMConfig is recommended to always install the latest version). The releases of the applications are available here:

In the following examples it was preferred to use the launch of the Start Service Intent rather than the launch of the Start Activity Intent where possible; only in the ADB example both the Intents are showed.

ADB:

  • Start Activity Intent:

adb shell am start -S -n com.datalogic.scan2deploy/.MainActivity --es data bhH25ICYKnlj6xLd0regetb1XlN9eGzrmbOQp6vPgYnjwm4aqBkSCTjkuR6hdEcw4WSLAfGk/kCgvFnayFNNMhQ+NEkvd3twMbK2HNdsNSFZm0USg7bzoLVRzxaXUkKewtiWAdWUVK7COenMzKcGcvZU9KojD4cK3f+nko822W5WtSxXdc/cQ8zOFLZnWXnjMnaJjri7VLDC9ZHqKdW/Row2i+pFmhn7MTQqx+VbRfAf3UgXRPA7fdTVm0NQh0C88fCuc1oYi2BF3yMuJV+/8v2bH0vifXH8mBTbwLL6ewzVcwVQyNvJJQATFsMgeUtbDaL2ikGrF4DrogkWuBZmwvTZ7tW242hVysG5a5Aa725ZJwtVaWiwK+iGW7cu7Z+cPu3AeLFt9bA0WMP1Zu5mmD7hjvIRgOl91Xqp1xqu12s6+b6EDQjUYxRah6DK6Vgo

  • Start Service Intent

adb shell am broadcast -a datalogic.scan2deploy.intent.action.START_SERVICE -n com.datalogic.scan2deploy/.S2dServiceReceiver --es encoding v2 --es data bhH25ICYKnlj6xLd0regetb1XlN9eGzrmbOQp6vPgYnjwm4aqBkSCTjkuR6hdEcw4WSLAfGk/kCgvFnayFNNMhQ+NEkvd3twMbK2HNdsNSFZm0USg7bzoLVRzxaXUkKewtiWAdWUVK7COenMzKcGcvZU9KojD4cK3f+nko822W5WtSxXdc/cQ8zOFLZnWXnjMnaJjri7VLDC9ZHqKdW/Row2i+pFmhn7MTQqx+VbRfAf3UgXRPA7fdTVm0NQh0C88fCuc1oYi2BF3yMuJV+/8v2bH0vifXH8mBTbwLL6ewzVcwVQyNvJJQATFsMgeUtbDaL2ikGrF4DrogkWuBZmwvTZ7tW242hVysG5a5Aa725ZJwtVaWiwK+iGW7cu7Z+cPu3AeLFt9bA0WMP1Zu5mmD7hjvIRgOl91Xqp1xqu12s6+b6EDQjUYxRah6DK6Vgo

SOTI:

  • Start Service Intent Soti Script:

sendIntent -b “intent:#Intent;component=com.datalogic.scan2deploy/.S2dServiceReceiver;action=datalogic.scan2deploy.intent.action.START_SERVICE;S.encoding=v2;S.data=bhH25ICYKnlj6xLd0regetb1XlN9eGzrmbOQp6vPgYnjwm4aqBkSCTjkuR6hdEcw4WSLAfGk/kCgvFnayFNNMhQ+NEkvd3twMbK2HNdsNSFZm0USg7bzoLVRzxaXUkKewtiWAdWUVK7COenMzKcGcvZU9KojD4cK3f+nko822W5WtSxXdc/cQ8zOFLZnWXnjMnaJjri7VLDC9ZHqKdW/Row2i+pFmhn7MTQqx+VbRfAf3UgXRPA7fdTVm0NQh0C88fCuc1oYi2BF3yMuJV+/8v2bH0vifXH8mBTbwLL6ewzVcwVQyNvJJQATFsMgeUtbDaL2ikGrF4DrogkWuBZmwvTZ7tW242hVysG5a5Aa725ZJwtVaWiwK+iGW7cu7Z+cPu3AeLFt9bA0WMP1Zu5mmD7hjvIRgOl91Xqp1xqu12s6+b6EDQjUYxRah6DK6Vgo;end”

You can try the Intent in the SOTI “Send Script” section

Airwatch:

  • Start Service Intent Airwatch Script

mode=explicit,broadcast=true,action=datalogic.scan2deploy.intent.action.START_SERVICE,package=com.datalogic.scan2deploy,class=com.datalogic.scan2deploy.S2dServiceReceiver,extraString=encoding=v2,extraString=data=bhH25ICYKnlj6xLd0regetb1XlN9eGzrmbOQp6vPgYnjwm4aqBkSCTjkuR6hdEcw4WSLAfGk/kCgvFnayFNNMhQ+NEkvd3twMbK2HNdsNSFZm0USg7bzoLVRzxaXUkKewtiWAdWUVK7COenMzKcGcvZU9KojD4cK3f+nko822W5WtSxXdc/cQ8zOFLZnWXnjMnaJjri7VLDC9ZHqKdW/Row2i+pFmhn7MTQqx+VbRfAf3UgXRPA7fdTVm0NQh0C88fCuc1oYi2BF3yMuJV+/8v2bH0vifXH8mBTbwLL6ewzVcwVQyNvJJQATFsMgeUtbDaL2ikGrF4DrogkWuBZmwvTZ7tW242hVysG5a5Aa725ZJwtVaWiwK+iGW7cu7Z+cPu3AeLFt9bA0WMP1Zu5mmD7hjvIRgOl91Xqp1xqu12s6+b6EDQjUYxRah6DK6Vgo

Sure MDM:

OEMConfig:
With OEMConfig, now, is only possible to launch the Start Activity Intent. The screens of the example are taken from SOTI.

  • Start Activity Intent
    Insert com.datalogic.scan2deploy in the Package Name field

    Select Extra Type “No Selection”, Extra Name “data”, Extra Value the Encrypted data copied.

    After that, the OEM Configuration will be applied, The Activity of S2D will start and will apply the configuration:

SDK Android:
– Start Service Intent (Java)

String data= "bhH25ICYKnlj6xLd0regetb1XlN9eGzrmbOQp6vPgYnjwm4aqBkSCTjkuR6hdEcw4W"+
                      "SLAfGk/kCgvFnayFNNMhQ+NEkvd3twMbK2HNdsNSFZm0USg7bzoLVRzxaXUkKewtiWA"+
                      "dWUVK7COenMzKcGcvZU9KojD4cK3f+nko822W5WtSxXdc/cQ8zOFLZnWXnj"+
                      "MnaJjri7VLDC9ZHqKdW/Row2i+pFmhn7MTQqx+VbRfAf3UgXRPA7fdTVm0" +
                       "NQh0C88fCuc1oYi2BF3yMuJV+/8v2bH0vifXH"+
                       "8mBTbwLL6ewzVcwVQyNvJJQATFsMgeUtbDaL2ikGrF4Drogk" +
                      "WuBZmwvTZ7tW242hVysG5a5Aa725ZJwtVaWiwK+iGW7cu7Z+"+
                       "cPu3AeLFt9bA0WMP1Zu5mmD7hjvIRgOl91Xqp1xqu12s6+b6EDQjUYxRah6DK6Vgo";
        Intent i = new Intent("datalogic.scan2deploy.intent.action.START_SERVICE")
                .putExtra("encoding", "v2")
                .putExtra("data", data)
                .setClassName("com.datalogic.scan2deploy", "com.datalogic.scan2deploy.S2dServiceReceiver");

        getApplicationContext().sendBroadcast(i);

Donato Cataldo
L3 Mobile Computer Specialist Support Engineer

3 Likes