Developer API Access

In the Developer API section of Device profile an MDM SDK is provided that can be used in your enterprise apps to get the device information and perform a wide variety of actions (like launching wifi screen, toggle mobile data, toggle hotspot etc.) locally on device. This ensures that the users can perform the actions from inside the app itself and they do not have to switch explicitly from the internal application to perform such actions.

The document describes what the SDK contains, how it can be integrated in your app and the actions that can be performed once it is integrated.

Prerequisites

  1. Device should be enrolled with Scalefusion
  2. At least one device profile is created

Steps

Step 1: Download the SDK zip file

  1. On Scalefusion Dashboard, navigate to Device Profiles & Policies > Device Profiles
  2. Create new or edit the existing Android Device Profile
  3. Navigate to Restrictions > Developer API
  4. Click on Download SDK button to download the Scalefusion Developer SDK in zip format to the host computer

Step 2: Extract the downloaded zip file

The zip file contains following in the SDK package:

  1. libs: Contains the *.aar file that you can import in your project
  2. MDMSDKSample: A sample Java based Android project to guide developer how to access the MDM APIs.
  3. TestApp: An APK that you can quickly install and try how the SDK works.
  4. MDM SDK Documentation.pdf: The documentation for MDM API.

Step 3: Integrate the SDK in your app

To integrate the SDK to your application, import/Include the library .aar file in your project and start using the APIs. Follow these steps:

  1. The first step is to copy the MDM SDK aar file from the downloaded zip file (mdm-sdk-1.5-5.aar) to the libs folder in your project. If the libs folder does not exist you can create one.
  2. Next, modify your project level build.gradle file to include flatDirs so that this project can be imported/used in your app.
  3. Now, add the library project to your app level build.gradle dependencies and sync so that the library is imported.
    The details are available in the documentation inside the SDK. Refer to the section Integrating the SDK in your app

Step 4: Use the APIs inside the app

Process on Dashboard

Once the SDK is integrated in the app, follow these steps on Dashboard:

  1. Install the application directly on a device that is being managed by Scalefusion or push this application via the Enterprise store on Scalefusion Dashboard.
  2. Once the application is installed, enable it in Device Profile from Select Apps
    The app highlighted in the screenshot below is a sample app
  3. Now go to Restrictions > Developer API.
    1. Select Applications: The Application drop-down contains list of all allowed apps (enabled in Select Apps). Select the one in which you want to access APIs.
    2. Associate Certificate SHA1: Associate the SHA1 of the signing certificate used to sign the app. This will secure the API calls and allow only if the allowed app is signed with same certificate. With having Sha1 certificate associated, only apps whose certificate match they are allowed to call the APIs on device.
      To associate SHA1, check the box which pre-fills the certificate details if the application is in enterprise store. Otherwise user can manually enter them.
      It is not mandatory to associate SHA1 certificate with the application
    1. Add Application: If you want to use the APIs in more than one application, click on Add Application. This adds another row where you can select the application and associate sha1
  4. Click on Update Profile
Accessing the APIs on Device
  1. Click on the app icon to launch it.
    The app should be set to visible. Only then it will show up on the home screen
  2. The application has two options using the bottom navigation pattern,
    1. Device Info: Shows the device & management information
    2. Actions: Displays the actions that can be performed. Click on an action to perform the action.

Following are the actions which can be performed on supported devices:

  • Launch Wifi Screen (if policy allows it)
  • Toggle Mobile Data, Hotspot, Flight Mode, Status/Notification bar
  • Install Pending APKs and Local APKs
  • Reboot the device
  • Lock the device
  • Power-off/Shutdown the device

Which are the supported devices on which the APIs can be accessed?

Support varies from device to device and some of these operations are not guaranteed to work on all devices. The MDM app should have support for the actions via any of the following means:

  1. EMM Managed devices
  2. Lenovo devices that support Lenovo SDK
  3. Samsung Knox devices
  4. Support of latest version of Wingman


How did we do?


Powered by HelpDocs (opens in a new tab)