Sorry, you need to enable JavaScript to visit this website.



Services initialization

Maps SDK for Android provides users with interfaces that can be used to manage connection between devices.

To obtain access to this module you will need to add following dependency to your build.gradle file:


Services module gives access to ConnectivityApi interface and PriorityConnectivityApi implementation.
ConnectivityApi is used to manage connections and send data between devices. In addition it also accepts multiple communicators that will be used to send/receive data.

ConnectivityApi provides access to following methods:

  • Connect

  • Disconnect

  • Send(Command)

In order to create an instance use PriorityConnectivityApiBuilder and provide required parameters to it which are:

  • StatusHandler

  • One or more CommunicatorFactory

  • One or more CommandModule


ConnectivityApi connectivityApi = new PriorityConnectivityApiBuilder(context)
            .addModule(new CommonCommandModule())
val connectivityApi = PriorityConnectivityApiBuilder(context)

StatusHandler will be used by ConnectivityApi for notification of an operations status.
To achieve that implement StatusHandler interface or create an ReferenceStatusHandler in the following manner:

protected val statusHandler = ReferenceStatusHandler(
    onReadStatusReady = { communicatorInfo, status -> onReadStatusReady(communicatorInfo, status) },
    onWriteStatusReady = { communicatorInfo, status -> onWriteStatusReady(communicatorInfo, status) },
    onConnectionStatusReady = { communicatorInfo, status -> onConnectionStatusReady(communicatorInfo, status) },
    onDisconnect = { communicatorInfo -> onDisconnect(communicatorInfo) }


By default, ConnectivityApi does not support any Communicator. Several communicator modules adapt
specific connection type:

  • Bluetooth SPP Server

  • Bluetooth SPP Client

  • Bluetooth Low Energy Server

  • Bluetooth Low Energy Client

You are here