### Install and Start Application using WAP Provisioning
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/appgallerymgr
This snippet illustrates installing an application and then starting it using WAP provisioning. It first uses the AppMgr characteristic to install the APK and then the Intent characteristic to start the main activity of the installed application.
```xml
```
--------------------------------
### Personal Shopper - Introduction and Setup
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/personalshopper
Provides an introduction to the EMDK for Android's Personal Shopper feature and demonstrates how to get access to the EMDKManager and create an instance of the PersonalShopper class.
```APIDOC
## Introduction to Personal Shopper
The EMDK for Android provides developers with tools to create Personal Shopper applications for the MC18 device. This feature type is specific to the MC18 personal shopper Android KK device and supports smart cradle and diagnostic interfaces.
### Getting EMDKManager Instance
```java
EMDKManager emdkManager = EMDKManager.getEMDKManager(getApplicationContext(), this);
```
### Creating PersonalShopper Instance
```java
PersonalShopper personalShopper = (PersonalShopper) this.emdkManager.getInstance(FEATURE_TYPE.PERSONALSHOPPER);
if (personalShopper == null) {
// This feature is not supported on the device in use.
}
```
```
--------------------------------
### Install Application via APK
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/appgallerymgr
Silently installs an application from a specified APK file path. The example shows installation of Clock.apk from the /enterprise/usr/persist folder.
```xml
```
--------------------------------
### Output XML for "Install Apps from Unknown Sources" Status
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/devadmin
This is an example output XML showing the status of the 'Install Apps from Unknown Sources' setting. A value of '1' typically indicates it is enabled. Note: Queries are not supported on Android 11 or later.
```xml
```
--------------------------------
### Query XML to Get Status of "Install Apps from Unknown Sources"
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/devadmin
This XML query retrieves the current status of the 'Install Apps from Unknown Sources' setting. Note: Queries are not supported on Android 11 or later.
```xml
```
--------------------------------
### Compiling with Latest Gradle (v7.0+)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/setup
Configuration for the latest Gradle versions (v7.0 and later) to compile EMDK for Android. It uses mavenCentral and specifies updated dependency versions.
```gradle
repositories {
google()
mavenCentral() /* <- formerly "jcenter()"
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
}
dependencies {
compileOnly 'com.symbol:emdk:9.1.1'
}
```
--------------------------------
### Profile Manager - Apply Device Profiles (Java)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/programming-guides
This guide provides an overview of using the Profile Manager to get instances, apply profile XMLs, interpret results, and understand response XML schemas. It enables developers to configure device settings based on application requirements.
```Java
/*
* This is a placeholder for a Java code example demonstrating the use of the Profile Manager API.
* Actual implementation involves loading and applying a profile XML to the device.
*/
// Example snippet (conceptual):
// EMDKManager emdkManager = EMDKManager.getGInstance();
// ProfileManager profileManager = (ProfileManager) emdkManager.getInstance(EMDKManager.FEATURE_TYPE.PROFILE);
//
// String profileXML = "
//
//
//
// ";
//
// String result = profileManager.processProfile(profileXML);
// // Handle the result string to check for success or failure
```
--------------------------------
### Compiling with Older Gradle (Pre-v7.0)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/setup
Configuration for older Gradle versions (prior to v7.0) to compile EMDK for Android. It includes JCenter repository and specific dependency versions.
```gradle
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
dependencies {
compileOnly 'com.symbol:emdk:9.1.1'
}
```
--------------------------------
### Settings Gradle for Latest Gradle Plugins
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/setup
Configuration within settings.gradle for projects using the latest Gradle plugins. It specifies repository modes and includes the Maven URL for EMDK dependencies.
```gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is deprecated; no updates allowed
maven {
url = "https://zebratech.jfrog.io/artifactory/EMDK-Android/"
}
}
}
```
--------------------------------
### EMDK Feature Characteristic Node Example (AppMgr)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/xmlresponseguide
This XML snippet illustrates a feature characteristic node, specifically for 'AppMgr' (Application Manager) with version '5.1'. It includes parameters like 'emdk_name' for unique identification within the profile, 'Action' to specify the operation (e.g., 'Install'), and 'APK' for the application package path.
```xml
```
--------------------------------
### Gradle Repositories for EMDK 9.1.1 and Later
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/setup
Configures the Maven repository for EMDK 9.1.1 and later releases. This uses a specific URL to resolve EMDK dependencies.
```gradle
repositories {
maven {
url = "https://zebratech.jfrog.io/artifactory/EMDK-Android/"
}
}
```
--------------------------------
### AndroidManifest.xml Queries Element for Android 11
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/setup
This XML snippet illustrates the inclusion of the `` element within the `AndroidManifest.xml` file, specifically targeting the EMDK service package. This is a crucial step for apps running on Android 11 and newer to ensure proper communication with the EMDK service.
```xml
...
...
```
--------------------------------
### EMDK Configuration and Profile Processing Example
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/xmlresponseguide
Demonstrates how to configure profiles using an EMDKConfig.xml file and process these profiles using the ProfileManager in Java. It also explains how feature names and types are derived from the XML structure.
```APIDOC
## EMDK Configuration and Profile Processing
### Description
This section provides an example of an `EMDKConfig.xml` file used for defining device profiles, specifically a 'ClockProfile-1'. It also includes a Java code snippet demonstrating how to use the `ProfileManager` to process these profiles, including updating specific parameters like date and time for features within the profile.
### Example XML Configuration (`EMDKConfig.xml`)
```xml
```
### Example Java Code for Profile Processing
```java
String[] extraData = new String[2];
extraData[0] = "Clk01.Date=2014-10-10"
extraData[1] = "Clk02.Time=10:10:10"
profileName = "ClockProfile-1/Clock/Clk01"
EMDKResults result = mProfileManager.processProfile(
profileName,
ProfileManager.PROFILE_FLAG.SET, extraData);
```
### Explanation
- `profileName`: Formatted as `ProfileName/featureType/featureName`.
- `ProfileName`: The value of the `ProfileName` parm in the `Profile` characteristic (e.g., "ClockProfile-1").
- `featureType`: The type of the feature characteristic (e.g., "Clock").
- `featureName`: The value of the `emdk_name` parm within the feature characteristic (e.g., "Clk01").
- `extraData`: An array of strings, where each string is a name-value pair used to override or set specific parameters within the profile features. Format: `featureName.parameterName=parameterValue`.
```
--------------------------------
### Configure Package Visibility for Android 11+ in AndroidManifest.xml
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/setup
For applications targeting Android 11 (API 30) or later, this XML snippet shows the required `` element to declare that your app needs to interact with the EMDK service. This addresses Android's package visibility restrictions.
```xml
...
```
--------------------------------
### Enable EMDK Permissions in AndroidManifest.xml
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/setup
This XML snippet demonstrates how to declare the necessary EMDK permission in the `AndroidManifest.xml` file. This permission is required for your application to interact with the EMDK services provided by Zebra devices.
```xml
...
```
--------------------------------
### Get Image Data from Byte Array (Java)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/signaturecapture
Extracts the image data from a larger byte array. It uses `Arrays.copyOfRange` to select a portion of the byte array, assuming the image data starts at a specific offset (byte index 6 in this example).
```java
byte[] sigDataArr //holds the total signature data byte array
byte[] imgDataArr = Arrays.copyOfRange(sigDataArr, 6, sigDataArr.length);
```
--------------------------------
### Get SAM Slot Index
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/samapiusage
This Java code retrieves the index of the SAM slot on the device. The index starts from 1 and identifies the specific physical slot the SAM occupies.
```java
int index = sam.getSamIndex();
```
--------------------------------
### Install Client Certificate and Private Key (.PFX) using XML Provisioning
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/certmgr
This XML snippet configures the installation of a client certificate along with its private key using a .PFX file. It specifies the certificate alias, type, method, the path to the .PFX file, and the private key password. This method also supports .P12 and .PKCS12 files.
```xml
```
--------------------------------
### Complete Android Manifest Configuration for EMDK
Source: https://techdocs.zebra.com/emdk-for-android/14-0/tutorial/tutMxWiFiManager
This example displays a simplified version of an AndroidManifest.xml file after incorporating both the EMDK permission and library declarations. It serves as a reference for the final configuration required.
```xml
...
```
--------------------------------
### XML Provisioning: Install Encryption Key (Output)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/encryptmgr
This XML snippet shows the output structure after an encryption key has been installed using the EncryptMgr characteristic. It includes parameters for the installation action and details of the installed key, such as its name.
```xml
```
--------------------------------
### Install or Upgrade Application
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/appmgr
This endpoint handles the installation or upgrade of applications using APK files or app bundles. It supports both user and system app installations/upgrades, with specific rules for signing and app bundle formats.
```APIDOC
## POST /api/apps/install
### Description
Installs or upgrades an application on the device using an APK file or an app bundle.
### Method
POST
### Endpoint
/api/apps/install
### Parameters
#### Request Body
- **APK** (string) - Required - The full path and name of the device-resident `.apk`, `.apks`, `.xapk`, or `.zip` file. For example: `/enterprise/appmgr/Herald.apk`.
- **Package** (string) - Optional - The Package Name(s) of one or more applications. Separate multiple Package Names using commas. This is shown if the Action is 'Install' or 'Upgrade'.
- **PackageSignature** (string) - Optional - The name of the certificate file for signing the application(s) specified in the Package name parameter. This is shown if the Protected List Action is 'Reserve Application UID'.
- **ApplicationName** (string) - Optional - The Name of the application for the selected Action. This is shown if the Action is 'Launch an application'.
### Request Example
```json
{
"APK": "/enterprise/appmgr/MyApplication.apk",
"Package": "com.mycompany.myapp",
"ApplicationName": "My Application"
}
```
### Response
#### Success Response (200)
- **status** (string) - The status of the installation/upgrade operation.
- **message** (string) - A message detailing the result of the operation.
#### Response Example
```json
{
"status": "success",
"message": "Application installed successfully."
}
```
```
--------------------------------
### Get SimulScanReader using Internal Camera Identifier
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/simulscan_guide
This Java code shows how to get a SimulScanReader instance using the INTERNAL_CAMERA1 identifier. It includes basic error handling for SimulScanException.
```java
try {
simulscanManager.getDevice(SimulScanDeviceIdentifier.INTERNAL_CAMERA1);
} catch (SimulScanException e) {
e.printStackTrace();
}
```
--------------------------------
### OS Update Zip File Example
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/powermgr
This snippet shows how to create an OS Update text file (.upl) containing a list of package zip files to be applied in order. This format is used for updating the device's OS.
```text
//Contents of the "osupdate.upl" text file:
package:M99N0KXXVPUCP14500.zip
package:CFE-M99-L-N0-010101_G_00_02.zip
// Note that package file names are preceded by the notation "package:"
```
--------------------------------
### Get SimulScan Status State
Source: https://techdocs.zebra.com/emdk-for-android/14-0/api/reference/deprecated-list
This code example shows how to get the current state of a SimulScan reader. It calls the getState() method from the SimulScanStatusData class. This feature is supported only on devices prior to Android 10 Q.
```Java
SimulScanStatusData.getState();
```
--------------------------------
### UI Elements for Default Launcher Setup (XML)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/tutorial/tutMxDefaultLauncher
Defines the UI elements within the activity_main.xml layout file. It includes a TextView for a label, an EditText for the user to input the package name of the launcher application, and a Button to trigger the default launcher setting process.
```XML
```
--------------------------------
### Scanner Parameter Config API - Get/Set Scanner Params (Java)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/programming-guides
This guide covers the pass-through APIs used to set and get scanner parameter configurations within scanning applications. It allows for fine-grained control over scanner behavior.
```Java
/*
* This is a placeholder for a Java code example demonstrating the Scanner Parameter Config API.
* Actual implementation involves using specific methods to get and set scanner parameters.
*/
// Example snippet (conceptual):
// EMDKManager emdkManager = EMDKManager.getGInstance();
// BarcodeManager barcodeManager = (BarcodeManager) emdkManager.getInstance(EMDKManager.FEATURE_TYPE.BARCODE);
// Scanner scanner = barcodeManager.getScanners().get(0);
// scanner.enable();
//
// // Get a parameter
// String currentValue = scanner.getConfig(). Tetapi.getProperty("scanner_timeout");
//
// // Set a parameter
// scanner.getConfig(). Tetapi.addProperty("scanner_timeout", "5000"); // Set timeout to 5 seconds
// scanner.loadConfiguration("new_config");
```
--------------------------------
### Install Client Certificate and Private Key (.PFX)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/wifi
Installs a client certificate and private key from a .PFX file using the CertMgr characteristic. Requires specifying the certificate alias, type, method, file path, and private key password. CertType 8 is used for PFX files.
```xml
```
--------------------------------
### Get SimulScanReader using Supported Devices Info
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/simulscan_guide
This Java snippet illustrates retrieving a SimulScanReader instance by first getting a list of supported devices and then selecting one from the list. Error handling for SimulScanException is included.
```java
List readerInfoList = simulscanManager.getSupportedDevicesInfo();
try {
simulscanManager.getDevice(readerInfoList.get(0));
} catch (SimulScanException e) {
e.printStackTrace();
}
```
--------------------------------
### Install Client Certificate and Private Key (.PKCS12)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/wifi
Installs a client certificate and private key from a .PKCS12 file using the CertMgr characteristic. Requires specifying the certificate alias, type, method, file path, and private key password. CertType 9 and CertMethod 10 are used for PKCS12 files.
```xml
```
--------------------------------
### Adjust Device Clock for Certificate Installation (XML)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/certmgr
This setting determines if the device clock should be automatically adjusted to the certificate's validity window start date when the certificate is installed. It's useful for devices with incorrect system dates that prevent certificate validation. Requires MX version 4.2+.
```XML
```
--------------------------------
### XML Provisioning: Install Encryption Key (Input)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/encryptmgr
This XML snippet demonstrates the input structure required to initiate the installation of an encryption key using the EncryptMgr characteristic in the Zebra EMDK. It targets the 'InstallKey' action.
```xml
```
--------------------------------
### Sample Manifest File
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/powermgr
A sample Android manifest file (XML format) showing various product and build properties for Zebra devices. This file is crucial for defining device characteristics and build information.
```xml
```
--------------------------------
### Submit XML with Missing APK for AppMgr Install (XML)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/xmlresponseguide
This XML snippet attempts to create a profile that includes an 'AppMgr' configuration to install an APK from '/sdcard/Test.apk'. However, this configuration will result in an error because the specified APK does not exist at the given path, demonstrating a common provisioning error.
```xml
```
--------------------------------
### Get External Vibrator NotificationDevice - Android Java
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/notification-api
This snippet shows how to get a NotificationDevice object for the pluggable External Vibrator using its specific device identifier. If this accessory is not available or supported on the device, the getDevice method will return null. This approach is direct and does not require prior device enumeration.
```java
NotificationDevice notificationDevice = notificationManager.getDevice(DeviceIdentifier.EXTERNAL_VIBRATOR1);
```
--------------------------------
### Install Client Certificate and Private Key (.P12)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/wifi
Installs a client certificate and private key from a .P12 file using the CertMgr characteristic. Requires specifying the certificate alias, type, method, file path, and private key password. CertType 9 is used for P12 files.
```xml
```
--------------------------------
### Get Profile (Java)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/profile-manager
Illustrates how to retrieve an existing profile using the PROFILE_FLAG.GET option. If the profile is found in the repository, it is returned within the extraData object. This example utilizes the ProfileConfig object, currently only supported for DataCapture profiles.
```java
@Override
public void onOpened(EMDKManager emdkmanager)
{
//Create the Profile Config object
ProfileConfig profileConfigObj = new ProfileConfig();
//Get the Profile Manager
ProfileManager profileManager = (ProfileManager)emdkmanager.getInstance(FEATURE_TYPE.PROFILE);
//Get the profile and store it in the ProfileConfig object
EMDKResults results = profileManager.processProfile("ProfileName", ProfileManager.PROFILE_FLAG.GET, profileConfigObj);
}
```
--------------------------------
### Install Client Certificate (.PEM)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/wifi
Installs a client certificate from a .PEM file into the Android KeyStore. This configuration specifies the certificate alias, type, method, file path, and clock adjustment settings.
```xml
```
--------------------------------
### Sample XML for Access Manager Profile (Java)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/tutorial/tutMxAccessManager
This Java code snippet shows a sample XML configuration for an Access Manager profile, specifically for the 'without Whitelist' feature. This XML is passed to the `processProfile` method of the ProfileManager to apply the settings.
```java
modifyData[0] = ""
+ ""
+ ""
+ ""
+ ""
+ "" + ""
```
--------------------------------
### Gradle Repositories for Older Gradle Versions
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/setup
Configures JCenter repository for older Gradle versions to resolve EMDK dependencies. This is relevant for EMDK releases prior to 9.1.1.
```gradle
repositories {
jcenter()
}
```
--------------------------------
### Initialize SerialCommManager and EMDKManager in Android Activity
Source: https://techdocs.zebra.com/emdk-for-android/14-0/api/reference/com/symbol/emdk/serialcomm/serialcommmanager
Example of initializing SerialCommManager, SerialComm, and EMDKManager within an Android Activity. This setup is necessary to leverage serial communication capabilities provided by the EMDK.
```java
public class MainActivity extends Activity implements EMDKListener {
SerialComm serialComm;
SerialCommManager serialCommManager;
EMDKManager emdkManager;
```
--------------------------------
### Configure App Feature: Launch Application After Install
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/appgallerymgr
Controls the 'Launch Application After Install' feature for a specified application package. Requires MX 14.0+ and Android API 33+.
```xml
```
--------------------------------
### Install Client Certificate (.PEM) using XML Provisioning
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/certmgr
This XML snippet shows how to install a client certificate's public key using the CertMgr characteristic. It requires the certificate alias, type, method, and the path to the .PEM file. Note that this method only installs the public certificate and not the private key, typically used for renewal scenarios.
```xml
```
--------------------------------
### Get SerialComm Port - EMDK for Android
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/serialcomm
This code shows how to retrieve a SerialComm port object. It involves first getting a list of supported serial ports using getSupportedPorts() and then selecting a specific port by passing its SerialPortInfo object to the getPort() method. Note that different Zebra devices may enumerate different numbers of ports.
```java
List serialPorts = serialCommManager.getSupportedPorts();
serialComm = serialCommManager.getPort(serialPorts.get(0));
```
--------------------------------
### Quick Tile Action Configuration
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/uimgr
Configure the action to be performed on Quick Settings tiles, such as showing, hiding, or resetting them. Platform notes indicate specific Android OSX version requirements for ET40 and other 6375-platform devices.
```APIDOC
## Configure Quick Tile Action
### Description
Configures the action to be performed on Quick Settings tiles.
### Method
UPDATE (or similar configuration method)
### Endpoint
`/api/device/settings/quicktile/action`
### Parameters
#### Query Parameters
- **QuickTileAction** (integer) - Required - Specifies the action for Quick Settings tiles.
- 0: Do not change
- 1: Show all
- 2: Hide all
- 3: Show individual
- 4: Hide individual
- 5: Reset to default
### Request Body
```json
{
"QuickTileAction": 1
}
```
### Response
#### Success Response (200)
- **status** (string) - Indicates the success of the operation.
#### Response Example
```json
{
"status": "success"
}
```
```
--------------------------------
### Get BarcodeManager Instance (Java)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/barcode_scanning_guide
Retrieves an instance of the BarcodeManager from the EMDKManager. This is a prerequisite for accessing any barcode scanning functionalities. Ensure EMDK is opened before calling this method.
```Java
BarcodeManager barcodeManager = (BarcodeManager)emdkManager.getInstance(FEATURE_TYPE.BARCODE);
```
--------------------------------
### Modify Profile (Java)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/profile-manager
Shows the process of modifying a profile. It involves getting the profile using PROFILE_FLAG.GET, updating feature parameters via the profileConfig object, and then saving the changes with PROFILE_FLAG.SET. This example uses ProfileConfig for DataCapture features.
```java
@Override
public void onOpened(EMDKManager emdkmanager)
{
//Create the Profile Config object
ProfileConfig profileConfigObj = new ProfileConfig();
//Get the Profile Manager
ProfileManager profileManager = (ProfileManager)emdkmanager.getInstance(FEATURE_TYPE.PROFILE);
//Get the profile and store it in the ProfileConfig object
EMDKResults results = profileManager.processProfile("ProfileName", ProfileManager.PROFILE_FLAG.GET, profileConfigObj);
//Enable MSR
profileConfigObj.dataCapture.msr.msr_input_enabled = ENABLED_STATE.TRUE;
//Modify Profile
EMDKResults ModifyResults = profileManager.processProfile("ProfileName", ProfileManager.PROFILE_FLAG.SET, profileConfigObj);
}
```
--------------------------------
### XML Feature Tag Example
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/xml
Demonstrates the basic structure of a Feature tag within an XML document for the XmlMgr CSP. This tag signifies the start of a feature's definition in the Request XML.
```xml
```
--------------------------------
### Java Enum Method: getValue() Usage
Source: https://techdocs.zebra.com/emdk-for-android/14-0/api/reference/com/symbol/emdk/notification/notificationresults
Provides an example of how to get the integer value associated with a NotificationResults enum constant. The documentation recommends using this primarily for UNDEFINED enums if needed at runtime.
```java
int errorCode = NotificationResults.FAILURE.getValue();
```
--------------------------------
### Device Administration API - Allow Application Installs from Unknown Sources
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/devadmin
Enables or disables the ability to install applications from unknown sources. A value of '1' enables it.
```APIDOC
## POST /deviceadmin/settings
### Description
Configures the setting for allowing application installs from unknown sources.
### Method
POST
### Endpoint
/deviceadmin/settings
### Parameters
#### Request Body
- **characteristic** (object) - Required - Contains device administration settings.
- **type** (string) - Required - Must be 'DevAdmin'.
- **version** (string) - Optional - Specifies the API version, e.g., '4.3'.
- **parm** (object) - Required - Contains the specific parameter to set.
- **name** (string) - Required - Must be 'UnknownSourcesStatus'.
- **value** (string) - Required - '1' to allow, '0' to disallow.
### Request Example
```json
{
"wap-provisioningdoc": {
"characteristic": {
"type": "DevAdmin",
"version": "4.3",
"parm": {
"name": "UnknownSourcesStatus",
"value": "1"
}
}
}
}
```
### Response
#### Success Response (200)
Indicates that the settings were updated successfully.
#### Response Example
```json
{}
```
```
--------------------------------
### Import EMDK Libraries and Implement Listener - Java
Source: https://techdocs.zebra.com/emdk-for-android/14-0/tutorial/tutMxCertificateManager
Imports the required EMDK libraries and defines the MainActivity class to implement the EMDKListener interface. This is the initial setup for using EMDK functionalities.
```java
import com.symbol.emdk.*;
import com.symbol.emdk.EMDKManager.EMDKListener;
import android.widget.Toast;
public class MainActivity extends Activity implements EMDKListener {
```
--------------------------------
### Initialize EMDK Manager and Get SimulScanManager
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/simulscan_guide
This snippet demonstrates how to obtain an instance of the SimulScanManager from the EMDKManager. It's crucial to release the EMDKManager in onDestroy() and onClose() and to release FEATURE_TYPE.SimulScan before switching applications.
```java
SimulScanManager simulscanManager = (SimulScanManager) emdkManager.getInstance(FEATURE_TYPE.SimulScan);
```
--------------------------------
### EMDK for Android Profile Manager Tutorials
Source: https://techdocs.zebra.com/emdk-for-android/14-0/tutorial
These tutorials cover various functionalities of the EMDK for Android's Profile Manager, including data capture, intent outputs, profile modification, and management of device features like Camera, Wi-Fi, and USB. They guide developers through setting up and utilizing different profile configurations.
--------------------------------
### Get SAM Manager Instance
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/samapiusage
This Java code retrieves an instance of the SAMManager from the EMDKManager. An EMDKManager instance must be obtained first before acquiring feature-specific managers like SAMManager.
```java
samManager = (SAMManager) emdkManager.getInstance(EMDKManager.FEATURE_TYPE.SAM);
```
--------------------------------
### Layout for Default Launcher Setting (XML)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/tutorial/tutmxdefaultlauncher
This XML snippet defines the layout for a screen that allows users to set a default launcher. It includes a TextView for instructions, an EditText for entering the package name, and a Button to trigger the action.
```xml
```
--------------------------------
### Provision XML to Allow Application Installs from Unknown Sources
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/devadmin
This XML enables the installation of applications from sources other than the Google Play Store. Use this setting with caution as it can pose security risks.
```xml
```
--------------------------------
### Get Signature Image Format from Byte Array in Android
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/signaturecapture
This snippet shows how to extract the image format from the first byte of the raw signature data byte array. The format is indicated by specific integer values.
```Java
int imageFormat = sigDataArr[0];
```
--------------------------------
### Get Signature Type from Byte Array in Android
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/signaturecapture
This snippet demonstrates how to retrieve the signature type from the second byte of the raw signature data byte array. Supported signature types are indicated by specific integer values.
```Java
int signatureType = sigDataArr[1]; //supported signature types: 2, 5, 7, 8, 9
```
--------------------------------
### Get SAM Type
Source: https://techdocs.zebra.com/emdk-for-android/14-0/guide/samapiusage
This Java code snippet demonstrates how to retrieve the type of a connected SAM object. The SAM type indicates the specific NFC technology it supports, such as MIFARE, CALYPSO, or FELICA.
```java
SAMType samType = sam.getSamType();
```
--------------------------------
### Query All UiMgr Settings (XML)
Source: https://techdocs.zebra.com/emdk-for-android/14-0/mx/uimgr
This XML snippet demonstrates how to query all available UiMgr settings. The output includes various parameters and nested characteristics for input methods.
```XML
```
```XML
```