This blog post describes the migration process for the Android TPA library from version 1.7.3 to 5.0.0. The main reasons for this release, and the large version bump, is to align the Android and iOS SDKs as well as fixing some internal inconsistencies.

API Requirements

We have dropped support for SDK Versions below 14, as this is no longer supported on the Google Play store.

Changes to TpaConfiguration

TpaConfiguration has received a major overhaul, mostly to align with iOS. This is just an overview of the changes, the documentation has more in depth explanations of the new API.

Everything is disabled by default

Previously a lot of features were enabled by default, from 5.0.0 and going forward features will be disabled by default.

Deprecations

  • useApi14 has been deprecated as SDK versions below 14 are no longer supported.
  • updateInterval has been deprecated. TPA will now check for updates each time the app is in the foreground.
  • useShakeFeedback has been deprecated and replaced with setFeedbackInvocation.
  • setLogType has been removed and replaced with setLoggingDestination.

New Options

  • setFeedbackInvocation replaces useShakeFeedback.
  • setLoggingDestionation replaces setLogType.
  • setUncaughtExceptionHandler replaces the uncaughtExceptionHandler parameter in TPA.initialize.
  • enableAnalytics is a new boolean options that toggles session recording and tracking.
  • setNonFatalIssuesEnabled is a new boolean that toggles non fatal issues.
  • setAutomaticUpdateCheckEnabled is a new boolean that toggles automatic update checks with the distribution library.
  • setMinimumLogLevelConsole set the minimum log level for logs sent to the console.
  • setMinimumLogLevelRemote set the minimum log level for logs sent to TPA.

Tracking

TpaTracker has been removed. All tracking is now done via TPA. Manual initialization of TpaEvent is no longer possible.

TpaTracker.track(category, name)        -> TPA.trackEvent(category, name)
TpaTracker.track(category, name, tags)  -> TPA.trackEvent(cateogry, name, tags)
TpaTracker.track(tpaEvent)              -> TPA.trackEvent(cateogry, name)

Logging

Similar to tracking TpaLog has been removed in favor of TPA.log.

TpaLog.d(TAG, “This is a debug log line”)       -> TPA.log.d(TAG, “This is a debug log line”)
TpaLog.i(TAG, “This is an info log line”)       -> TPA.log.i(TAG, “This is an info log line”)
TpaLog.w(TAG, “This is a warning log line”)     -> TPA.log.w(TAG, “This is a warning log line”)
TpaLog.e(TAG, “This is an error log line”)      -> TPA.log.d(TAG, “This is an error log line”)

TagsBuilder

The utility class TagsBuilder has been added to simplify building tag maps.

TPA.trackEvent(category, name, new TagsBuilder()
    .addTag("My Tag", "My Value")
    .build());