Android changelog

Version 7.1.0 (2023-08-23)

Version 7.0.2 (2022-12-15)

Version 7.0.1 (2022-11-22)

Version 7.0.0 (2022-10-07)

Version 6.2.0 (2022-08-17)

Version 6.2.0-rc01 (2022-07-25)

Version 6.1.2 (2022-02-18)

Version 6.1.1 (2021-12-01)

Version 6.1.0 (2021-10-20)

Important changes since version 6.0.0:

Version 6.1.0-rc02 (2021-10-13)

NOTE: This version depends on Jetpack WorkManager 2.7.0-rc01 which might be unstable at the moment.

Version 6.1.0-rc01 (2021-10-04)

NOTE: This version depends on Jetpack WorkManager 2.7.0-rc01 which might be unstable at the moment.

Version 6.1.0-beta02 (2021-09-13)

NOTE: This version depends on Jetpack WorkManager 2.7.0-beta01 which might be unstable at the moment.

Version 6.1.0-beta01 (2021-08-27)

NOTE: This version depends on Jetpack WorkManager 2.7.0-alpha05 which might be unstable at the moment.

Version 6.0.0 (2021-07-08)

This commit in the sample app repository demonstrates how to update from version 5.x.x to 6.0.0.

Version 5.5.2 (2021-06-22)

Version 5.5.1 (2021-05-25)

Version 5.5.0 (2021-05-17)

Please change the maven repository declaration as follows: maven { url "https://pkgs.dev.azure.com/motiontag/releases/_packaging/releases/maven/v1" }.

The old https://artifactory.motion-tag.de/artifactory/libs-release Maven repository will be deactivated on January 31, 2022.

Version 5.4.0 (2021-05-07)

Version 5.3.0 (2021-03-15)

Version 5.2.0 (2021-02-11)

Version 5.1.0 (2020-12-11)

Version 5.0.0 (2020-11-24)

val channel = NotificationChannel("tracking_channel_id", "channel title", NotificationManager.IMPORTANCE_LOW)
// Other configurations
channel.setShowBadge(false)
notificationManager.createNotificationChannel(channel)

val notification = NotificationCompat.Builder(context, "tracking_channel_id")
    .setPriority(NotificationCompat.PRIORITY_LOW)
    // Other configurations
    .build()
notification.flags = Notification.FLAG_ONGOING_EVENT

Version 4.2.0 (2020-09-14)

Version 4.1.0 (2020-09-04)

Version 4.0.0 (2020-07-24)

Version 3.0.0 (2020-06-10)

This is a major release and it is not backward compatible with the previous ones.

de.motiontag.tracker.models.Event -> de.motiontag.tracker.Event

de.motiontag.tracker.models.Event.AutoStart -> de.motiontag.tracker.AutoStartEvent

de.motiontag.tracker.models.Event.AutoStop -> de.motiontag.tracker.AutoStopEvent

de.motiontag.tracker.models.Event.Location -> de.motiontag.tracker.LocationEvent

de.motiontag.tracker.models.Event.Transmission -> de.motiontag.tracker.TransmissionEvent

de.motiontag.tracker.models.Reason -> de.motiontag.tracker.Reason

This event informs when a package of events has been successfully sent to the server. The timestamp represents the time of the server confirmation response. The trackedFrom and trackedTo represent the time range of the transmitted events.

This event informs when a package of events failed to be transmitted to the server. The timestamp represents the time of the failure. The errorCode and errorMessage describes the error that occurred.

Version 2.4.0 (2020-03-18)

Version 2.3.2 (2020-03-11)

This version fixes a bug that could prevent sensor data from being transmitted to our server.

Version 2.3.1 (2020-02-13)

Version 2.3.0 (2020-02-12)

IMPORTANT:

The OS will automatically grant this permission to existing apps. However, this is not the case for new app installs, therefore developers must request this permission before starting the SDK.

A few helper functions were added to help developers with the task of verifying and requesting the correct permissions and location settings:

MotionTag.hasRequiredLocationSettings(): Checks if the device has all the required location settings.

MotionTag.hasRequiredPermissions(): Checks if the app has all the required permissions.

MotionTag.getRequiredPermissions(): Returns an array with all the required permissions.

MotionTag.requestRequiredLocationSettings(Activity activity, int requestCode): Displays a dialog that allows users to enable all the required location settings.

MotionTag.requestRequiredPermissions(Activity activity, int requestCode): Requests the required runtime permissions to the user.

Please check our documentation for more information.

Other changes:

Version 2.2.7 (2020-01-27)

Version 2.2.6 (2020-01-16)

Version 2.2.5 (2020-01-15)

Version 2.2.4 (2020-01-07)

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)