repositories {
maven {
url 'https://dmrc.io/packages/android'
}
}
dependencies {
implementation 'com.digimarc.mobile:dms:3.7.2'
}
dependencies {
implementation files('libs/dms.aar')
}
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">
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. |
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.
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>