Package-level declarations

Types

Link copied to clipboard
sealed class ApplicationState

ApplicationState is intended to be used in MobileService.onStateChange method (possibly in when clause). To make its usage consistent, make all the subclasses data class, even SettingsParameterReady and HTTPClientReady may not need the ready parameter. Sample code: when (state) { is ApplicationState.HTTPClientReady -> httpClientReady = state.ready is ApplicationState.AuthenticationChange -> authenticated = state.authenticated ... }

Link copied to clipboard

Represents the state holder of the application. When the application state changes, the state change producer will notify this holder, then the state will be saved inside this, and notify the observers which are interested in the state changes. For example, if one service wants to do something when the application is brought to background, it can observe the ApplicationState.OnFrontChange, and if the operation also depends on other state, for example, http client must be ready, it can query this state holder for that state.

Link copied to clipboard
Link copied to clipboard
abstract class MobileService

Represents the base class for all mobile services, for example, UserService, etc. Each service represents a feature that the mobile app wants to use. To use a service, create an instance of that service, then feed to SDKInitializer to initialize it, then later client code can get the instance from SDKInitializer.

Link copied to clipboard

Represents the utility to initialize MobileService used by the mobile app when starting the app. Usually start function should be called in 'onCreate' of your Application.

Link copied to clipboard

Represents the service error types.

Link copied to clipboard
interface ServiceListener<T>

Represents the listener to be notified with a service result.

Link copied to clipboard
sealed class ServiceResult<T>

Represents the result for services SUCCESS The request was successful and returned the correct result. FAILURE The request failed and return the error code and message. To avoid confusion, please use the FAILURE.code for processing first; the FAILURE.httpErrorCode is only valid when the FAILURE.code value is ServiceErrorCode.HTTP_STATUS_ERROR_FOR_JOULE.

Link copied to clipboard
typealias StateListener = (ApplicationState) -> Unit
Link copied to clipboard

Represents the abstract service to handle the case that when the app is put into background and brought up to the foreground, how to handle the timeout passcode policy.