Radar

object Radar

The main class used to interact with the Radar SDK.

See also

Types

RadarBeaconCallback
Link copied to clipboard
interface RadarBeaconCallback
Called when a beacon ranging request succeeds, fails, or times out.
RadarContextCallback
Link copied to clipboard
interface RadarContextCallback
Called when a context request succeeds, fails, or times out.
RadarGeocodeCallback
Link copied to clipboard
interface RadarGeocodeCallback
Called when a geocoding request succeeds, fails, or times out.
RadarIpGeocodeCallback
Link copied to clipboard
interface RadarIpGeocodeCallback
Called when an IP geocoding request succeeds, fails, or times out.
RadarLocationCallback
Link copied to clipboard
interface RadarLocationCallback
Called when a location request succeeds, fails, or times out.
RadarLocationSource
Link copied to clipboard
enum RadarLocationSource : Enum<Radar.RadarLocationSource>
The sources for location updates.
RadarLogLevel
Link copied to clipboard
enum RadarLogLevel : Enum<Radar.RadarLogLevel>
The levels for debug logs.
RadarMatrixCallback
Link copied to clipboard
interface RadarMatrixCallback
Called when a matrix request succeeds, fails, or times out.
RadarRouteCallback
Link copied to clipboard
interface RadarRouteCallback
Called when a distance request succeeds, fails, or times out.
RadarRouteMode
Link copied to clipboard
enum RadarRouteMode : Enum<Radar.RadarRouteMode>
The travel modes for routes.
RadarRouteUnits
Link copied to clipboard
enum RadarRouteUnits : Enum<Radar.RadarRouteUnits>
The distance units for routes.
RadarSearchGeofencesCallback
Link copied to clipboard
interface RadarSearchGeofencesCallback
Called when a geofence search request succeeds, fails, or times out.
RadarSearchPlacesCallback
Link copied to clipboard
interface RadarSearchPlacesCallback
Called when a place search request succeeds, fails, or times out.
RadarStatus
Link copied to clipboard
enum RadarStatus : Enum<Radar.RadarStatus>
The status types for a request.
RadarTrackCallback
Link copied to clipboard
interface RadarTrackCallback
Called when a track request succeeds, fails, or times out.
RadarTripCallback
Link copied to clipboard
interface RadarTripCallback
Called when a trip update succeeds, fails, or times out.

Functions

acceptEvent
Link copied to clipboard
fun acceptEvent(eventId: String, verifiedPlaceId: String? = null)
Accepts an event.
autocomplete
Link copied to clipboard
fun autocomplete(query: String, near: Location? = null, limit: Int? = null, callback: Radar.RadarGeocodeCallback)
Autocompletes partial addresses and place names, sorted by relevance.
fun autocomplete(query: String, near: Location? = null, limit: Int? = null, block: (status: Radar.RadarStatus, addresses: Array<RadarAddress>?) -> Unit)
Autocompletes partial addresses and place names, sorted by relevance.
fun autocomplete(query: String, near: Location? = null, layers: Array<String>? = null, limit: Int? = null, country: String? = null, callback: Radar.RadarGeocodeCallback)
Autocompletes partial addresses and place names, sorted by relevance.
fun autocomplete(query: String, near: Location? = null, layers: Array<String>? = null, limit: Int? = null, country: String? = null, block: (status: Radar.RadarStatus, addresses: Array<RadarAddress>?) -> Unit)
Autocompletes partial addresses and place names, sorted by relevance.
cancelTrip
Link copied to clipboard
fun cancelTrip(callback: Radar.RadarTripCallback? = null)
Cancels a trip.
fun cancelTrip(block: (status: Radar.RadarStatus, trip: RadarTrip?, events: Array<RadarEvent>?) -> Unit)
Cancels a trip.
completeTrip
Link copied to clipboard
fun completeTrip(callback: Radar.RadarTripCallback? = null)
Completes a trip.
fun completeTrip(block: (status: Radar.RadarStatus, trip: RadarTrip?, events: Array<RadarEvent>?) -> Unit)
Completes a trip.
geocode
Link copied to clipboard
fun geocode(query: String, callback: Radar.RadarGeocodeCallback)
Geocodes an address, converting address to coordinates.
fun geocode(query: String, block: (status: Radar.RadarStatus, addresses: Array<RadarAddress>?) -> Unit)
Geocodes an address, converting address to coordinates.
getContext
Link copied to clipboard
fun getContext(callback: Radar.RadarContextCallback)
Gets the device's current location, then gets context for that location without sending device or user identifiers to the server.
fun getContext(block: (status: Radar.RadarStatus, location: Location?, context: RadarContext?) -> Unit)
Gets the device's current location, then gets context for that location without sending device or user identifiers to the server.
fun getContext(location: Location, callback: Radar.RadarContextCallback)
Gets context for a location without sending device or user identifiers to the server.
fun getContext(location: Location, block: (status: Radar.RadarStatus, location: Location?, context: RadarContext?) -> Unit)
Gets context for a location without sending device or user identifiers to the server.
getDescription
Link copied to clipboard
fun getDescription(): String?
Returns the current description.
getDistance
Link copied to clipboard
fun getDistance(destination: Location, modes: EnumSet<Radar.RadarRouteMode>, units: Radar.RadarRouteUnits, callback: Radar.RadarRouteCallback)
Gets the device's current location, then calculates the travel distance and duration to a destination.
fun getDistance(destination: Location, modes: EnumSet<Radar.RadarRouteMode>, units: Radar.RadarRouteUnits, block: (status: Radar.RadarStatus, routes: RadarRoutes?) -> Unit)
Gets the device's current location, then calculates the travel distance and duration to a destination.
fun getDistance(origin: Location, destination: Location, modes: EnumSet<Radar.RadarRouteMode>, units: Radar.RadarRouteUnits, callback: Radar.RadarRouteCallback)
Calculates the travel distance and duration from an origin to a destination.
fun getDistance(origin: Location, destination: Location, modes: EnumSet<Radar.RadarRouteMode>, units: Radar.RadarRouteUnits, block: (status: Radar.RadarStatus, routes: RadarRoutes?) -> Unit)
Calculates the travel distance and duration from an origin to a destination.
getLocation
Link copied to clipboard
fun getLocation(callback: Radar.RadarLocationCallback? = null)
Gets the device's current location.
fun getLocation(block: (status: Radar.RadarStatus, location: Location?, stopped: Boolean) -> Unit)
Gets the device's current location.
fun getLocation(desiredAccuracy: RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy, callback: Radar.RadarLocationCallback? = null)
Gets the device's current location with the desired accuracy.
fun getLocation(desiredAccuracy: RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy, block: (status: Radar.RadarStatus, location: Location?, stopped: Boolean) -> Unit)
Gets the device's current location with the desired accuracy.
getMatrix
Link copied to clipboard
fun getMatrix(origins: Array<Location>, destinations: Array<Location>, mode: Radar.RadarRouteMode, units: Radar.RadarRouteUnits, callback: Radar.RadarMatrixCallback)
Calculates the travel distances and durations between multiple origins and destinations for up to 25 routes.
fun getMatrix(origins: Array<Location>, destinations: Array<Location>, mode: Radar.RadarRouteMode, units: Radar.RadarRouteUnits, block: (status: Radar.RadarStatus, matrix: RadarRouteMatrix?) -> Unit)
Calculates the travel distances and durations between multiple origins and destinations for up to 25 routes.
getMetadata
Link copied to clipboard
fun getMetadata(): JSONObject?
Returns the current metadata.
getTrackingOptions
Link copied to clipboard
fun getTrackingOptions(): RadarTrackingOptions
Returns the current tracking options.
getTripOptions
Link copied to clipboard
fun getTripOptions(): RadarTripOptions?
Returns the current trip options.
getUserId
Link copied to clipboard
fun getUserId(): String?
Returns the current userId.
initialize
Link copied to clipboard
fun initialize(context: Context?, publishableKey: String? = null)
Initializes the Radar SDK.
fun initialize(context: Context?, publishableKey: String? = null, receiver: RadarReceiver? = null)
Initializes the Radar SDK.
ipGeocode
Link copied to clipboard
fun ipGeocode(callback: Radar.RadarIpGeocodeCallback)
Geocodes the device's current IP address, converting IP address to partial address.
fun ipGeocode(block: (status: Radar.RadarStatus, address: RadarAddress?, proxy: Boolean) -> Unit)
Geocodes the device's current IP address, converting IP address to partial address.
isTracking
Link copied to clipboard
fun isTracking(): Boolean
Returns a boolean indicating whether tracking has been started.
jsonForLocation
Link copied to clipboard
fun jsonForLocation(location: Location): JSONObject
Returns a JSON object for a location.
mockTracking
Link copied to clipboard
fun mockTracking(origin: Location, destination: Location, mode: Radar.RadarRouteMode, steps: Int, interval: Int, callback: Radar.RadarTrackCallback?)
Mocks tracking the user's location from an origin to a destination.
fun mockTracking(origin: Location, destination: Location, mode: Radar.RadarRouteMode, steps: Int, interval: Int, block: (status: Radar.RadarStatus, location: Location?, events: Array<RadarEvent>?, user: RadarUser?) -> Unit)
Mocks tracking the user's location from an origin to a destination.
rejectEvent
Link copied to clipboard
fun rejectEvent(eventId: String)
Rejects an event.
reverseGeocode
Link copied to clipboard
fun reverseGeocode(callback: Radar.RadarGeocodeCallback)
Gets the device's current location, then reverse geocodes that location, converting coordinates to address.
fun reverseGeocode(block: (status: Radar.RadarStatus, addresses: Array<RadarAddress>?) -> Unit)
Gets the device's current location, then reverse geocodes that location, converting coordinates to address.
fun reverseGeocode(location: Location, callback: Radar.RadarGeocodeCallback)
Reverse geocodes a location, converting coordinates to address.
fun reverseGeocode(location: Location, block: (status: Radar.RadarStatus, addresses: Array<RadarAddress>?) -> Unit)
Reverse geocodes a location, converting coordinates to address.
searchGeofences
Link copied to clipboard
fun searchGeofences(radius: Int, tags: Array<String>?, metadata: JSONObject?, limit: Int?, callback: Radar.RadarSearchGeofencesCallback)
Gets the device's current location, then searches for geofences near that location, sorted by distance.
fun searchGeofences(radius: Int, tags: Array<String>?, metadata: JSONObject?, limit: Int?, block: (status: Radar.RadarStatus, location: Location?, geofences: Array<RadarGeofence>?) -> Unit)
Gets the device's current location, then searches for geofences near that location, sorted by distance.
fun searchGeofences(near: Location, radius: Int, tags: Array<String>?, metadata: JSONObject?, limit: Int?, callback: Radar.RadarSearchGeofencesCallback)
Search for geofences near a location, sorted by distance.
fun searchGeofences(near: Location, radius: Int, tags: Array<String>?, metadata: JSONObject?, limit: Int?, block: (status: Radar.RadarStatus, location: Location?, geofences: Array<RadarGeofence>?) -> Unit)
Search for geofences near a location, sorted by distance.
searchPlaces
Link copied to clipboard
fun searchPlaces(radius: Int, chains: Array<String>?, categories: Array<String>?, groups: Array<String>?, limit: Int?, callback: Radar.RadarSearchPlacesCallback)
Gets the device's current location, then searches for places near that location, sorted by distance.
fun searchPlaces(radius: Int, chains: Array<String>?, categories: Array<String>?, groups: Array<String>?, limit: Int?, block: (status: Radar.RadarStatus, location: Location?, places: Array<RadarPlace>?) -> Unit)
Gets the device's current location, then searches for places near that location, sorted by distance.
fun searchPlaces(near: Location, radius: Int, chains: Array<String>?, categories: Array<String>?, groups: Array<String>?, limit: Int?, callback: Radar.RadarSearchPlacesCallback)
Search for places near a location, sorted by distance.
fun searchPlaces(near: Location, radius: Int, chains: Array<String>?, categories: Array<String>?, groups: Array<String>?, limit: Int?, block: (status: Radar.RadarStatus, location: Location?, places: Array<RadarPlace>?) -> Unit)
Search for places near a location, sorted by distance.
setAdIdEnabled
Link copied to clipboard
fun setAdIdEnabled(enabled: Boolean)
Enables adId (Android advertising ID) collection.
setDescription
Link copied to clipboard
fun setDescription(description: String?)
Sets an optional description for the user, displayed in the dashboard.
setForegroundServiceOptions
Link copied to clipboard
Settings for the foreground notification when the foregroundServiceEnabled parameter is true on Radar tracking options.
setLogLevel
Link copied to clipboard
fun setLogLevel(level: Radar.RadarLogLevel)
Sets the log level for debug logs.
setMetadata
Link copied to clipboard
fun setMetadata(metadata: JSONObject?)
Sets an optional set of custom key-value pairs for the user.
setReceiver
Link copied to clipboard
fun setReceiver(receiver: RadarReceiver?)
Sets a receiver for client-side delivery of events, location updates, and debug logs.
setUserId
Link copied to clipboard
fun setUserId(userId: String?)
Identifies the user.
startTracking
Link copied to clipboard
fun startTracking(options: RadarTrackingOptions)
Starts tracking the user's location in the background.
startTrip
Link copied to clipboard
fun startTrip(options: RadarTripOptions, callback: Radar.RadarTripCallback? = null)
Starts a trip.
fun startTrip(options: RadarTripOptions, block: (status: Radar.RadarStatus, trip: RadarTrip?, events: Array<RadarEvent>?) -> Unit)
Starts a trip.
stopTracking
Link copied to clipboard
fun stopTracking()
Stops tracking the user's location in the background.
stringForMode
Link copied to clipboard
fun stringForMode(mode: Radar.RadarRouteMode): String
Returns a display string for a travel mode value.
stringForSource
Link copied to clipboard
fun stringForSource(source: Radar.RadarLocationSource): String
Returns a display string for a location source value.
stringForTripStatus
Link copied to clipboard
fun stringForTripStatus(status: RadarTrip.RadarTripStatus): String
Returns a display string for a trip status value.
trackOnce
Link copied to clipboard
fun trackOnce(callback: Radar.RadarTrackCallback? = null)
Tracks the user's location once in the foreground.
fun trackOnce(block: (status: Radar.RadarStatus, location: Location?, events: Array<RadarEvent>?, user: RadarUser?) -> Unit)
Tracks the user's location once in the foreground.
fun trackOnce(location: Location, callback: Radar.RadarTrackCallback?)
Manually updates the user's location.
fun trackOnce(location: Location, block: (status: Radar.RadarStatus, location: Location?, events: Array<RadarEvent>?, user: RadarUser?) -> Unit)
Manually updates the user's location.
fun trackOnce(desiredAccuracy: RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy, beacons: Boolean, callback: Radar.RadarTrackCallback? = null)
Tracks the user's location once with the desired accuracy and optionally ranges beacons in the foreground.
fun trackOnce(desiredAccuracy: RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy, beacons: Boolean, block: (status: Radar.RadarStatus, location: Location?, events: Array<RadarEvent>?, user: RadarUser?) -> Unit)
Tracks the user's location once with the desired accuracy and optionally ranges beacons in the foreground.
updateTrip
Link copied to clipboard
fun updateTrip(options: RadarTripOptions, status: RadarTrip.RadarTripStatus?, callback: Radar.RadarTripCallback? = null)
Manually updates a trip.
fun updateTrip(options: RadarTripOptions, status: RadarTrip.RadarTripStatus?, block: (status: Radar.RadarStatus, trip: RadarTrip?, events: Array<RadarEvent>?) -> Unit)
Manually updates a trip.