initialize

fun initialize(context: Context, activity: Activity?, timer: TimerService? = null, internalPath: String? = null, externalPath: String? = null, language: String? = null, languageTts: String? = null, savePolicy: GemSdk.EDataSavePolicy? = null, listener: ProgressListener? = null, appVariant: Int? = null, useApiExceptions: Boolean = false, logger: ApiCallLogger? = ApiCallLogger(), autoInitLiveDataSource: Boolean? = null, breakpadCallback: (Boolean) -> Unit? = null, token: String? = null, generateGPSLog: Boolean = false): Int

Initialize GEM sdk. All GEM sdk objects must be used after a successful call to this function.

Return

GemError.NoError - Success.

The error code if it fails. See GemError

Parameters

context

Android context.

activity

Initial activity where this sdk will be initialized.

timer

This is used on platforms were the timer service cannot be implemented inside the Magic Earth Engine or when the API client can provide better timer service implementation. Default: Internal impl of TimerService.

listener

This is used to get notifications about the services manager creation progress. Default: null

appVariant

Application variant. Multiple applications can use the same application variant. Default: 0

internalPath

The path to the "Data" folder of the application located on internal/phone storage. Default: Util.getAppDirInternalPath with provided context as input.

externalPath

The path to the "Data" folder of the application located on external/SdCard storage. Default: Util.getAppFilesDirExternalPath with provided context as input.

savePolicy

Instructs the engine where to save the data. Default: EDataSavePolicy.UseExternalOnly

useApiExceptions

This will enable the throwing exceptions mechanism for SDK fatal errors ( experimental ) Default: false

logger

API calls logger. Default null

language

The SDK language.

languageTts

The SDK TTS language. If empty is provided ( default ), the TTS will use the SDK language Default : ""

autoInitLiveDataSource

If SDK initializes with success then will call automatically "PositionService.dataSource = produceDefaultLiveDataSource ()". If this value is false then the SDK user must provide a DataSource to PositionService. Default : true

breakpadCallback

Callback that will be used by breakpad to notice if the dump was successfully saved or not. If both phone and SdCard paths are NULL then the default paths will be used by the SDK.