Android SDK 7.X

See the full list of changes in our release notes: https://github.com/hypertrack/sdk-android/releases/tag/7.0.0

Setting the publishable key

There is no need to initialize the SDK by setting publishable key. The Basic integration instructions describe the new way of setting it.

Static API

The SDK API was fully redesigned to be more ergonomic and to require less code to use. All the API methods can be accessible at any time from any place in the app by calling them on the static HyperTrack class. See Changelog for all method changes.

New Maven artifact ID

The old dependency in build.gradle should be removed:

implementation "com.hypertrack:hypertrack:${version}"

Follow the Add HyperTrack SDK to your project tutorial to configure the new SDK.

Android Plugin Architecture

HyperTrack SDK Android uses the Plugin architecture to be able to adapt to different dependencies and add configurable logic.

ACTIVITY_RECOGNITION permission is no longer required

While the SDK still can benefit from Motion activity data to get better accuracy, requesting this permission is now optional.

SDK Sync

The SDK is now automatically syncs with the servers, so the syncDeviceSettings() method is not needed. You can safely remove it and all the logic related to it.

New Json.Object param type for addGeotag and metadata

In the new version you need to build a special Json.Object object to send the data to the SDK.

See the Identify devices metadata section for details on how to use it.

New nested HyperTrack.Error

In older versions there were 2 ways to get the SDK errors:

  1. With addTrackingListener()/addAvailabilityListener() onError callback
  2. With Blockers API HyperTrack.getBlockers()

In the new version both of the APIs above are removed and replaced with Errors API (HyperTrack.errors/HyperTrack.subscrbeToErrors())

Check the Handle errors section for the details on how to use that API.

Here is the table of correspondence between the TrackingError/Blocker and according HyperTrack.Error types:

Old ErrorHyperTrack.Error
TrackingError.UNKNOWN_ERROR-- removed --
TrackingError.INVALID_PUBLISHABLE_KEY_ERRORError.InvalidPublishableKey
TrackingError.AUTHORIZATION_ERROR-- removed --
TrackingError.PERMISSION_DENIED_ERRORError.Permissions.Location.Denied
TrackingError.GPS_PROVIDER_DISABLED_ERRORError.Location.ServicesDisabled
TrackingError.UNKNOWN_NETWORK_ERROR-- removed --
TrackingError.DATA_STORE_ERROR-- removed --
Blocker.LOCATION_PERMISSION_DENIEDError.Permissions.Location.Denied
Blocker.LOCATION_SERVICE_DISABLEDError.Location.ServicesDisabled
Blocker.ACTIVITY_PERMISSION_DENIED-- removed --
Blocker.BACKGROUND_LOCATION_DENIEDError.Permissions.Location.Denied
OutageReason.MISSING_LOCATION_PERMISSIONError.Permissions.Location.Denied
OutageReason.MISSING_ACTIVITY_PERMISSION-- removed --
OutageReason.LOCATION_SERVICE_DISABLEDError.Location.ServicesDisabled
OutageReason.NOT_TRACKINGLocationError.NotRunning
OutageReason.START_HAS_NOT_FINISHEDLocationError.Starting
OutageReason.NO_GPS_SIGNALError.Location.SignalLost
OutageReason.RESTART_REQUIRED-- removed --