NAV
Sample

Setup

Android

    repositories {
        ...
        flatDir {
           dirs 'libs'
        }
        ...
    }

    dependencies {
        ...
        implementation 'com.medm.devicekit:MedMDeviceKit:+@aar'
        ...
    }
  1. Copy MedMDeviceKit.aar to your project libs directory.
  2. Add flatDir repository with aar path to repositories section of your app's build.gradle.
  3. Add implementation 'com.medm.devicekit:MedMDeviceKit:+@aar' to dependencies section of your app's build.gradle.

iOS

  1. Drag and drop the MedMDeviceKit.xcframework to your project navigator menu.
  2. Check 'Copy if needed' option.
  3. Select the target in the project settings editor.
  4. Select the 'Build Phases' tab, and add MedMDeviceKit.xcframework to 'Embed Frameworks' list.

Initialization

Use MedMDeviceKit.init in order to initialize the SDK. Init must be called before any other method. Use license provided to you by MedM. For Demo Edition any string is valid.

Prerequisites

Android

In order to use Bluetooth connectivity SDK requires following permissions:

The SDK notifies IErrorCallback.onPermissionsRequired() in case any of these conditions aren't met. You can check Google documentation for the further explanation.

iOS

The SDK requires Bluetooth to be enabled. Otherwise ErrorCallback.onBluetoothTurnedOff() will be called. The system requests users' permission on the first call to the API. The app has to provide text for this request. To do that, add Privacy - Bluetooth Always Usage Description(NSBluetoothAlwaysUsageDescription) to your properties list.

Usage

The main entry point of the library is MedMDeviceKit class. There are three main components: MedMScanner, MedMDeviceManager and MedMCollector.

Background execution

If the application is expected to connect to Bluetooth devices in background some additional actions are required.

Android

The app must request ACCESS_BACKGROUND_LOCATION permission on Android 10 - 11 and use a foreground service. Depending on the target phone manufacturer it might be necessary to: request disabling battery optimizations, request wake lock, or ask a user to disable manufacturer-specific battery optimizations.

iOS

More