Skip to main content

Import

Initialization

.initialize

Initializes the positioning engine with your OneS1ght API key. Pass baseUrl only if you run your own server (default OneS1ght.DEFAULT_BASE_URL).

.requestPermission

Requests the app permissions needed to use the positioning engine.

.setLanguage

Sets the language of SDK log messages.
ko: Korean, ja: Japanese, en: English, null: system language

.onDebugLog

Receives SDK logs.
level: log level, message: log message

.reset

Discards the session, stops positioning, and clears the stored key and building context. Call initialize again afterwards (until then, NotInitialized, E1001).

State

.isInitialized

Returns whether initialization succeeded.

.deviceAvailability

Tells whether the device supports positioning and, if not, why. Read it after initialize() — before that it is DEVICE_NOT_SUPPORTED (OS_VERSION_TOO_LOW below Android 17).

.googleMapKey

Returns the Google Maps API key for displaying the floor plan.

.SDK_VERSION

Returns the SDK version in use.

Profiles

.createProfile

Creates a new personalization profile. Returns a unique profile ID on success.

.identify

Links the profile that collected positioning data is grouped under. Set null to unlink.

.fetchProfile

Fetches the profile’s attributes.

.replaceProfile

Replaces the profile’s attributes. The previous data is deleted.

.deleteProfile

Permanently deletes the profile.

Space lookup

.buildings

Fetches every building that belongs to the tenant.

.floors

Fetches the floors of a building.

.floor

Fetches the details of the selected floor.

.zones

Fetches every zone on the selected floor.

.locators

Fetches the locators on the selected floor.

Setting the floor

.setFloorMap

Sets the floor used for zone events (optional). Coordinates arrive without it, but zone events and campaigns need it.

.refreshZones

Fetches the latest zone data.

Positioning session

.floorSession

Returns the positioning session. It is a single app-wide instance not tied to a floor, and throws NotInitialized before initialize.

.begin

Starts positioning the user.

.end

Stops positioning the user.

.pause · .resume

Pauses and resumes positioning. Unlike end, the positioning engine inside the SDK keeps running.

.isRunning · .isPaused

Returns whether positioning is running and whether it is paused.

Session events

.onPosition

Delivers the user’s coordinates in real time, at the rate the engine produces them; only server uploads are downsampled to the console setting (4 per second by default).

.onZoneEnter · .onZoneExit

Fires when the user enters or exits a zone.

.onZoneDwell

Fires when the dwell time in a zone exceeds the threshold (dwellSeconds).

.onTriggers

Fires when an in-space event (campaign) is triggered.

.onFloorDetected

Called with the floor ID when the engine finds a floor from locator BLE signals, and with null when the floor is lost.

.onStopped

Fires when positioning stops.

.onConfigChanged

Fires when settings change in the console.

Data upload

Coordinates are uploaded automatically every 300 entries or 60 seconds, as well as when the app goes to the background and on end().

.uploadPendingPositions

Uploads buffered coordinates immediately.

.discardPendingPositions

Discards buffered coordinates.

Error handling

Failures arrive as SdkError (SDK state) and ApiError (communication, co.onecheck.ones1ght.android.network.ApiError). See Error codes for details.

Models

Lists are List<T>, bytes are ByteArray.

Coordinates

Building · Floor

Locator · FloorLocators

Zone

Trigger

Enums (ConfigChange · StopReason · PermissionStatus · DeviceAvailability · LogLevel) may gain values in minor versions — keep an else branch in when.

Limitations

  • suspend APIs can be called from any coroutine. Call identify · discardPendingPositions · pause · resume on the main thread.
  • UWB positioning is foreground only. In the background positioning stops, the zone the user was in is treated as exited (onZoneExit), and the live stream is cut. On return positioning restarts and ResyncNeeded arrives.
  • The coordinate buffer is kept in app memory — unsent coordinates are lost if the app is force-quit.
  • Positioning does not work on the emulator.