Documentation for maplib/Common.kt

fun colorToHexString(color: Int) : String

Convert Color int to hex string.

parameter color

Color in integer representation.

returns

Hex string.

fun isBetterLocation(location: Location, currentBestLocation: Location?) : Boolean

Determines whether one Location reading is better than the current Location fix

parameter location

The new Location that you want to evaluate

parameter currentBestLocation

The current Location fix, to which you want to compare the new one

fun checkPermission(context: Context, permission: String) : Boolean

Check if permission is granted or not. On Android M or higher do real work, otherwise return true.

returns

True if permission granted

fun startTrackerService() : Context, command: TrackerService.Command, extraIntent: Intent? = null,

Start, stop or update tracker service

parameter context

Application context

parameter command

Tracker service command enum value

parameter extraIntent

Intent to put in service start intent EXTRA_INTENT field

parameter options

Key - value string map. Key set to intent key, and value - to intent value.

parameter delegate

Delegate for tracker service events.

fun printError(message: String)

Print error message to console

parameter message

Error to print

fun printMessage(message: String)

Print message to console

parameter message

Message to print

fun printWarning(message: String)

Print warning message to console

parameter message

Warning message to print