Skip to main content

Datalogic Android SDK

Distribution

The Datalogic Android SDK is distributed using Apache Maven. More information can be found below.

Overview

The Datalogic Android SDK allows developers to write Android apps using both Java and Kotlin languages to access features available on Datalogic Android devices. The Datalogic Android SDK is distributed as 2 separate APIs, the standard APIs, and the self-shopping APIs.

Releases

A list of released versions of the Datalogic Android SDK is available here.

Standard APIs

Provides essential APIs related to the device scanner and device itself.

Self-shopping APIs

Provides APIs related to the locking cradle available for use with Joya Touch Android and Memor 1 devices.

Supported devices

The tables below indicate when support for a given version of the SDK was added to a device's firmware.

FirmwareOSRelease dateSecurity PatchSDK add-onScanner ServiceS2D Agent
3.26.001112024-01-152024-01-051.34.7
3.25.001112023-12-142023-12-051.34.7
3.24.001112023-11-082023-11-051.34.72.2.0.31-r1-249
3.23.001112023-10-172023-10-051.34.4
3.22.002112023-09-222023-09-051.34.4
3.21.001112023-08-282023-08-051.34.42.2.0.27-r3-2472.1.0
3.20.002112023-07-172023-07-051.34.2
3.19.001112023-06-062023-06-051.34.22.0.8
3.17.001112023-05-112023-05-051.33.7
3.16.001112023-04-192023-04-051.332.2.0.21-r4-2391.40.2
3.15.001112023-03-162023-03-051.30
3.14.001112023-02-162023-02-051.30
3.13.001112023-01-102023-01-051.30
3.11.001112022-12-142022-12-051.30
3.10.001112022-11-092022-11-051.30
3.09.001112022-10-102022-10-051.30
3.06.004112022-07-182022-05-051.302.2.0.14-r1-127 1.33.7665
2.13.003102022-10-172022-03-011.30
2.12.008102022-04-202022-03-011.30
2.11.006102021-11-102021-09-011.29
2.10.005102021-07-092021-06-011.28
2.09.052102021-03-302021-02-011.272.1.0.3-r2-1101.28
2.08.050102021-02-042020-11-051.25

Using the SDK

Datalogic maintains two ways to use the Datalogic Android SDK in your project:

Maven Dependency

The SDK code is available as a repository on Github and can be easily referenced in the project's gradle build system and compiled as a maven dependency with JitPack.

The latest version of the SDK is SDK Version .

Depending on whether your project uses Groovy or Kotlin for gradle scrips, please choose the proper syntax.

Add jitpack.io repository

In the settings.gradle file of the project add the following line:

maven { url "https://jitpack.io" }

This line can be added in your settings.gradle file into the dependencyResolutionManagement block as follows:

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}

Add a dependency on the SDK

Add a reference to the specific version of the SDK you would like to use to your app/build.gradle file. In this example, we are using version 1.34. You can see a list of all released versions here.

dependencies {
...
implementation 'com.github.datalogic:datalogic-android-sdk:1.34'
...
}

Add a dependency on self-shopping SDK

Add a reference to the specific version of the self-shopping SDK you would like to use to your app/build.gradle file. In this example, we are using version v1.8b. You can see a list of all released versions here. Look for references to the Selfshopping extension.

dependencies {
...
implementation 'com.github.datalogic:datalogic-android-sdk-selfshopping:v1.8b'
...
}

SDK Add-on

Install Android Studio

Download Android Studio from the official website and follow the installation instructions. After installing Android Studio, install the Android SDK through the Android SDK Manager or provide a correct path to one already installed. Since developers are encouraged to target the most recent and updated Android SDK release while developing an application, choose the most new API level released and download the associated platform.

Install Datalogic SDK Add-on

From Android Studio launch window, click Configure > SDK Manager to open Android SDK Manager.

Install SDK As

Install SDK As Menu

Select the tab SDK Update Sites and click the + (plus) icon on the right-side toolbar.

Install SDK As SDK Manager

In the new window insert the following URL, optionally a name and then press OK

https://datalogic.github.io/android-sdk-addon/addon.xml

Install SDK as site URL

Now select the tab SDK Platforms in the Android SDK settings panel and check the checkbox on the bottom right Show Package Details.

SDK Manager

Under each displayed section, corresponding to the Android releases available, Datalogic SDK v1 Add-on should appear. Choose and install the development kit in accordance with your Android platform of choice. To install it, check Datalogic SDK v1 checkbox and a small icon on the left should appear.

Important

Please notice that you must also install the Android API platform matching the Android version in use for development in your environment (i.e. API 23 is required to compile apps supported up to Android 6.0). See Platform version for further details.

SDK Platforms

Click on the button Apply to install the selected packages and confirm the choice in the next dialog.

SDK confirm

Now, read and understand the corresponding End-User License Agreement (EULA) available in the next window. Accept it, in order to install Datalogic Android SDK.

License agreement

Installing requested components

Once the installation is complete, the Status of the Datalogic SDK v1 Add-on changes from Not installed to Installed. You are now ready to start developing applications compatible with Datalogic devices.

SDK status changed

Create new applications

When creating a new project choose Start a new Android Studio project from the Android Studio Welcome screen. Welcome to Android Studio

Important

Please notice that you must select the Minimum SDK level in accordance with the installed Android firmware version on your Datalogic device. For example, a device running Android Jelly Bean, can support applications built with Minimum SDK level selected up to 16. Greater values will produce an incompatible Android app.

When creating a new project, choose the most correct Minimum SDK API level and press Next.

Create New Project

The wizard will guide through the creation of a new application.

Configure your new project

With a choice of basic layout and Activity styles.

Add an activity to mobile

Complete the guided wizard and let the IDE settle down. A generic Android application, runnable on all Android devices, is now ready for development.

Compile projects

With the previous steps, you have simply prepared a basic environment for a generic Android application. Through the next steps, instead, your basic application will leverage on custom Datalogic SDK functionalities and will be compiled to be compatible with a Datalogic device.

In order to gain access to the SDK functionalities, applications need to be compiled with the right Datalogic SDK environment. To do so, right click on app folder under the Android project module, then select Open Module Settings.

Start as compile

In the following window point to Project Structure > Modules app tab Properties and change the Compile Sdk Version accordingly, matching the right Datalogic SDK with the API level in use. In the showed example we are compiling apps with the latest Android 6.0 API level, meaning we need to select a corresponding Datalogic SDK matching the same level (remember to download and install the matching Datalogic Add-on). Confirm the choice by pressing OK.

Important

The following step is mandatory in order to prepare the environment correctly

Start as compile with SDK

Android Studio will now switch to the Datalogic SDK v1, allowing you to develop and extend your app to the Datalogic Android APIs. Take a look at the API reference and available sample apps.

Gradle scripts

Compiling an application with the Datalogic SDK it is a matter of matching and using the most correct configuration of the build.gradle file associated to the application.

In the following example we are matching the targetSdkVersion with a corresponding level of Datalogic SDK Add-on (the trailing number is exactly 23):

apply plugin: 'com.android.application'

android {
compileSdkVersion 'Datalogic:Datalogic SDK v1:23'
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "com.example.generic.myapplication"
minSdkVersion 16
targetSdkVersion 23
}
}

If you are pointing to a different target version, install the matching Datalogic SDK v1 Add-on through the Android SDK Manager.

Android application manifest

Android applications must have generally an App Manifest (AndroidManifest.xml), where all information about the application itself are exposed. Datalogic device compatible apps, relying on Datalogic SDK, require a mandatory change to the Android application manifest in order to work. It is strictly necessary the right usage of <uses-library> tag, to protect the developed applications against misuse and installation on incompatible devices. In addition the <uses-library> links your application against the Datalogic SDK or possible Datalogic SDK Extension whenever is launched.

Important

Please notice that this step is mandatory to make your application fully compatible with the Datalogic SDK installed on the device. Don not forget to include all the libraries that you rely on or use, inside the AndroidManifest.xml.

The inclusion of the following tag (within the <application> element) in all Android applications built with the Datalogic SDK is necessary:

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.DeviceDefault" >

<uses-library
android:name="com.datalogic.device"
android:required="true" />
</application>

While, in case of use of a further Datalogic SDK Extension, the following change is mandatory (e.g. Selfshopping Extension):

<uses-library
android:name="com.datalogic.extension.selfshopping"
android:required="true" />

Pay attention while changing the required libraries inside your application's AndroidManifest. If you strictly rely on certain extension, do not forget to emphasize it with android:required tag. Thanks to it, you will protect your application from installation on incompatible devices.