Getting Started

Requirements

Integrate the SDK

Gradle

  1. Add the Digimarc Maven repository to the project-level build.gradle.
  2.     repositories {
          maven {
            url 'https://dmrc.io/packages/android'
          }
        }
      
  3. Add the DM SDK artifact as a dependency in the module-level build.gradle.
  4.     dependencies {
          implementation 'com.digimarc.mobile:dms:3.7.2'
        }
      

Manual Installation

  1. Download and unzip the DM SDK package.
  2. Copy dms.aar into the module's libs directory.
  3. Add the DM SDK binary as a dependency.
  4.     dependencies {
          implementation files('libs/dms.aar')
        }
      

Add Your License Key

In your app's AndroidManifest.xml file, add the license key under the application tag.

    <meta-data android:name="com.digimarc.LicenseKey"
      android:value="your-license-key">
  

Sample Applications

The DM SDK package contains three sample applications, each demonstrating different use cases. The apps can be found under the Sample Apps directory. Each app directory contains a Readme.md file describing the application, its operation, and its use cases.

DetectorViewDemo Kotlin app that uses the DMSDetectorView all-in-one control. DMSDetectorView provides the easiest way to create an app that detects Digimarc Barcode, traditional 1D barcodes, QR codes, and Digimarc Barcode for Audio.
DMSDemo Java app that demonstrates the core DM SDK APIs. These APIs provide the most flexibility for customizing your app's detection process.
DMStockTake Java app that demonstrates Digimarc Barcode and 1D Barcode scanning at longer distances as in a store "stock-taking" environment. This app provides a good starting point for retail, warehouse, or other scanning scenarios.

SDK Permissions

DM SDK declares the following permissions in its manifest:

Permission Reason
Camera The CameraHelper and DMSDetectorView classes within the SDK use the camera to capture images for reading. The Camera permission is required for an application to open and use a device's camera.
Record Audio The AudioCaptureReader and DMSDetectorView classes within the SDK use the microphone to listen for audio watermarks. The Record Audio permission is required for an application to open and use the microphone.

These permissions from the SDK are merged into your application's manifest during the build process. As noted in the description column above, the permissions are used by the SDK for specific detection types. Camera permission is required if your application is using the device's camera to read Digimarc Barcodes, 1D Barcodes or QR Codes. Record Audio permission is required if your application is detecting Digimarc Barcode for Audio (note that for the DMSDetectorView component audio detection is on by default).

Internet permission is not required, although some SDK capabilities, like resolving payloads, will not function without it. When internet permission is present, the SDK uses the internet to download updated camera settings from the Digimarc backend and to report anonymized usage metrics.


Removing Permissions

If your application does not use one of the detection types you can exclude the permission from your manifest. This is not required. On Android 6.0+ camera and audio permissions are not granted until the user has consented to their use. The primary reason to exclude a permission is to prevent it from appearing during application installation on older versions of Android.

Permissions can be removed from your application at build time using the tools:node package's remove command. For more information on the manifest merge process refer to the Android documentation.

The following example removes the Record Audio permission. Note that as shown here the tools namespace must be present in the manifest root.

<manifest ... xmlns:tools="http://schemas.android.com/tools">
    ...
    <uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove"/>
    ...
</manifest>

Back to Documentation