MapTrip SDK Android Manual 9.8.8
BaseTask Class Reference

The task is the SDK's way to control and inform about its asynchronous operations
More...

+ Inheritance diagram for BaseTask:

Public Member Functions

ApiError cancel ()
 
boolean equals (Object o)
 
native String getLastErrorDescription ()
 
native double getProgress ()
 
native ApiError getReturnValue ()
 
ApiError join ()
 

Detailed Description

All asynchronous SDK methods return a task object. The task object contains information on the progress, the result and can be used to cancel the task or wait for it to finish (block program execution). The progress and finished information of a task are received via callbacks. ( TaskListener.taskProgress() TaskListener.taskFinished() ) The classes or objects that initiate the task (see Geocoder or Navigation) provide appropriate callback setters.

If multiple tasks are triggered (e.g. multiple calls to Geocoder.listAddress()), the same callback function is triggered. The callback that initiated the callback is passed as parameter to the callback function and can be compared to the tasked that has been returned by the task initating function (e.g. Geocoder.listAddress() ) with the passed as parameter in the callback isIdentical method

Attention
This is only the base version of an asynchronous task. All SDK methods will return a Task<T> object that offers the possibility to retrieve a result object of the task. In case that no result object is generated by the Task it will by of type Task<Void>

Member Function Documentation

◆ cancel()

ApiError cancel ( )

Aborts the task. If the task is aborted the return value of the task result callback is ApiError.OPERATION_CANCELLED.

Returns
Errorcode

◆ equals()

boolean equals ( Object  o)
inherited

◆ getLastErrorDescription()

native String getLastErrorDescription ( )

Returns
textual description of the last occurred error for the given task

◆ getProgress()

native double getProgress ( )

Returns
the task progress in percent in the range 0 to 100.0

◆ getReturnValue()

native ApiError getReturnValue ( )

Returns
tasks return code. Its value depends on the task itself and is documented with the function that created the task Errorcode

◆ join()

ApiError join ( )

Waits for the task to be finished.

Returns
Errorcode

The documentation for this class was generated from the following file: