Menu

Android Analytics SDK Changelog

Version 2.2.3 (2019-12-05)

Version 2.2.2 (2019-11-12)

Version 2.2.1 (2019-10-03)

Version 2.2.0 (2019-09-13)

IMPORTANT:

Starting from version 2.2.0, the SDK requires compileSdkVersion 29 or higher. Apps targeting API 29 must request both android.permission.ACCESS_FINE_LOCATION and android.permission.ACCESS_BACKGROUND_LOCATION runtime permissions, otherwise the SDK will not work properly on Android 10.

After requesting the location permissions, Android 10 users will get a dialog with 3 different options to choose from. Users must select “Allow all the time” option, otherwise the SDK won’t function properly.

Version 2.1.0 (2019-09-02)

Version 2.0.0 (2019-08-23)

FROM

Returns Method Explanation
void onAutoStart(Reason.Start reason) Informs the application that tracking has been automatically started.
void onAutoStop(Reason.Stop reason) Informs the application that tracking has been automatically stopped.
void onLocation(Location location) Hands the latest captured android.location.Location. to the application.
void onTransmission(long timestamp) Informs when a package of events has been successfully sent to the server. The timestamp parameter represents the time (in milliseconds) of the server confirmation response.

TO

Returns Method Explanation
void onEvent(Event event) Informs the application about a new incoming event.
Event Explanation
AutoStart(Reason.Start reason) Event informs application that tracking has been automatically started.
AutoStop(Reason.Stop reason) Event informs application that tracking has been automatically stopped.
LocationEvent(Location location) Event hands the latest captured android.location.Location. to the application.
Transmission(long timestamp) Event informs when a package of events has been successfully sent to the server. The timestamp parameter represents the time (in milliseconds) of the server confirmation response.

FROM

class CustomClass implements MotionTag.Callback {

    @Override
    public void onAutoStart(Reason.Start reason) {
        switch (reason) {
            case RESTART: 
                // do something after the tracking was restarted 
                // after rebooting the phone or updating the application.
                break;
            case LOCATION_SERVICE: 
                // do something after the tracking was restarted 
                // by turning on the location services.
                break;
            case KILLED: 
                // do something after the application has been killed and 
                // the tracking is restarted.
                break;
        }
    }

    @Override
    public void onAutoStop(Reason.Stop reason) {
        switch (reason) {
            case RESTART:
                // do something after the tracking was stopped 
                // because the phone was shut down
                break;
            case LOCATION_SERVICE:                
                // do something after the tracking was stopped
                // by turning off the location services.
                break;
            case LOCATION_PERMISSION:
                // do something after the tracking was stopped
                // by revoking the location permissions.
                break;
        }
    }
}

TO

Java

class CustomClass implements MotionTag.Callback {

    @Override
    public void onEvent(Event event) {
        switch (event.getType()) {
            case AUTO_START: 
                // do something after the tracking was restarted, e.g.
                onAutoStart(event.getReason());
                break;
            case AUTO_STOP: 
                // do something after the tracking was stopped, e.g.
                onAutoStop(event.getReason());
                break;
            case LOCATION: 
                // do something after the application provides a location, e.g.
                onLocation(event.getLocation());
                break;
            case TRANSMISSION: 
                // do something after the application has successfully transmitted data, e.g.
                onTransmission(event.getTransmittedAt());
                break;
        }
    }

    private void onAutoStart(Reason.Start reason) {
        switch (reason) {
            case RESTART: 
                // do something after the tracking was restarted 
                // after rebooting the phone or updating the application.
                break;
            case LOCATION_SERVICE: 
                // do something after the tracking was restarted 
                // by turning on the location services.
                break;
            case KILLED: 
                // do something after the application has been killed and 
                // the tracking is restarted.
                break;
        }
    }
    
    private void onAutoStop(Reason.Stop reason) {
        switch (reason) {
            case RESTART:
                // do something after the tracking was stopped 
                // because the phone was shut down
                break;
            case LOCATION_SERVICE:                
                // do something after the tracking was stopped
                // by turning off the location services.
                break;
            case LOCATION_PERMISSION:
                // do something after the tracking was stopped
                // by revoking the location permissions.
                break;
        }
    }
    
    private void onLocation(Location location) {
        // Maybe display the location on a map
    }
    
    private void onTransmission(Long transmittedAt) {
        // Maybe display the time, so the user gets informed that data will be analysed soon
    }
}

Kotlin

class CustomClass : MotionTag.Callback {

    override fun onEvent(event: Event) {
        when (event) {
            is Event.AutoStart -> onAutoStart(event.reason) // do something after the tracking was restarted, e.g.
            is Event.AutoStop -> onAutoStop(event.reason) // do something after the tracking was stopped, e.g.
            is Event.LocationEvent -> onLocation(event.location) // do something after the application provides a location, e.g.
            is Event.Transmission -> onTransmission(event.transmittedAt) // do something after the application has successfully transmitted data, e.g.
        }
    }

    private fun onAutoStart(reason: Reason.Start) {
        when (reason) {
            RESTART -> TODO() // do something after the tracking was restarted after rebooting the phone or updating the application.
            LOCATION_SERVICE -> TODO() // do something after the tracking was restarted by turning on the location services.
            KILLED -> TODO() // do something after the application has been killed and the tracking is restarted.
        }
    }
    
    private fun onAutoStop(reason: Reason.Stop) {
        when (reason) {
            RESTART -> TODO() // do something after the tracking was stopped because the phone was shut down
            LOCATION_SERVICE -> TODO() // do something after the tracking was stopped by turning off the location services.
            LOCATION_PERMISSION -> TODO() // do something after the tracking was stopped by revoking the location permissions.
        }
    }
    
    private fun onLocation(location: Location) {
        // Maybe display the location on a map
    }
    
    private fun onTransmission(transmittedAt: Long) {
        // Maybe display the time, so the user gets informed that data will be analysed soon
    }
}

Version 1.6.1 (2019-05-22)