Android changelog
Version 5.1.0 (2020-12-11)
- Improved: Reduce data transmission by up to 50%
- Changed: Immediately trigger the creation of user in our backend after starting the SDK
- Fixed: Fix
RemoteServiceException
crashes when trying to launch the foreground service
Version 5.0.0 (2020-11-24)
- Changed: The SDK's foreground notification will now be displayed only when the device is moving, therefore we recommend app developers to use a low priority notification coupled with a low importance channel in order to not disturb the user every time they start moving.
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
- Improved: The SDK size has been reduced from 30 MB to 8 MB.
- Improved: Tracking restart algorithm has been refactored and improved.
Version 4.2.0 (2020-09-14)
- Improved: Reduce data transmission by up to 20%.
Version 4.1.0 (2020-09-04)
- Fixed: Event class Java interoperability issue.
- Improved: Reduce delay to publish user's last storyline item.
- Improved: Mode detection accuracy.
Version 4.0.0 (2020-07-24)
- Added: Support for Android 11. Apps targeting SDK version 30 or later must be granted
android.permission.ACCESS_FINE_LOCATION
permission before requestingandroid.permission.ACCESS_BACKGROUND_LOCATION
. More information in the official Android documentation. An example implementation can be found in our sample app. - Added:
MotionTag.getDeniedRequiredPermissions()
. This function returns aList<String>
with the required runtime permissions that are still denied. - Changed:
MotionTag.getRequiredPermissions()
now returns aList<String>
instead of anArray<String>
. - Changed:
de.motiontag.tracker.Reason.Start
andde.motiontag.tracker.Reason.Stop
were merged tode.motiontag.tracker.Reason
. - Removed:
MotionTag.requestRequiredPermissions(activity, requestCode)
public function. Please useActivityCompat.requestPermissions(activity, permissions, requestCode)
to manually request permissions.MotionTag.getRequiredPermissions()
can be used to retrieve an array with the required runtime permissions. - Removed:
MotionTag.checkIn()
andMotionTag.checkOut()
public functions. - Improved: Tracking restart algorithm.
Version 3.0.0 (2020-06-10)
This is a major release and it is not backward compatible with the previous ones.
Some packages and classes have been moved and/or renamed as follows:
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
Added
TransmissionEvent.Success
event: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.
Added
TransmissionEvent.Error
event: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.
Removed
MotionTag.turnLoggingOn(on: Boolean)
andSettings.Builder.turnLogginOn(on: Boolean)
public functions.Improved mode detection accuracy.
Version 2.4.0 (2020-03-18)
- Reduce data transmission by up to 60%.
Version 2.3.2 (2020-03-11)
- Update
WorkManager
dependency version to 2.3.3.
This version fixes a bug that could prevent sensor data from being transmitted to our server.
Version 2.3.1 (2020-02-13)
- Remove
<uses-feature android:name="android.hardware.sensor.stepdetector" />
feature fromAndroidManifest.xml
.
Version 2.3.0 (2020-02-12)
IMPORTANT:
- The SDK now requires
android.permission.ACTIVITY_RECOGNITION
runtime permission when running on Android 10.
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:
Reason.Stop.LOCATION_PERMISSION
was renamed toReason.Stop.PERMISSION
- Improve mode detection accuracy
- Restructure internal background jobs
Version 2.2.7 (2020-01-27)
- Improve tracking restart when the app is killed by Android OS
- Fix crash in the SDK when Auto Backup feature is enabled in the app
- Add Auto Backup section to the documentation
Version 2.2.6 (2020-01-16)
- Fix crash when accessing internal database from multiple threads
Version 2.2.5 (2020-01-15)
- Speed up SDK initialization process by lazy loading the local database
- Add an additional exception listener to investigate crashes when first time opening app
Version 2.2.4 (2020-01-07)
- Add exception listener to investigate crashes when first time opening app
Version 2.2.3 (2019-12-05)
- Fix a crash when using the SDK together with Firebase Performance Monitoring
Version 2.2.2 (2019-11-12)
MotionTag.isTrackingActive()
now returns false when tracking is interrupted
Version 2.2.1 (2019-10-03)
- Reduce battery consumption
- Schedule periodic jobs with WorkManager
- Remove library restriction from
useWifiOnlyDataTransfer
method - Hide internal SDK resources
Version 2.2.0 (2019-09-13)
- Add support for Android 10
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)
- Reduce battery consumption
- Improve tracking restart when the app is killed by Android OS
Version 2.0.0 (2019-08-23)
- Section 2.3
MotionTag.Callback
changed ...
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. |
- Section 3.5 Automatic Start/Stop changed ...
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)
- Remove unused bluetooth permission
- Fix crash when parsing geofence event