Snowplow Android Tracker 0.8.0 released

02 July 2018  •  Mike Hadam

We are pleased to announce a new release of the Snowplow Android Tracker.

Version 0.8.0 fixes a bug that stops Android lifecycle tracking whenever an activity is destroyed. The release also adds methods to set and view the custom contexts sent with lifecycle events.

Read on below the fold for:

  1. Adding contexts to the lifecycle tracking
  2. Fixing a bug in the lifecycle tracking
  3. Documentation
  4. Getting help

1. Adding contexts to the lifecycle tracking

The new methods in the tracker are: setLifecycleCustomContexts and getLifecycleCustomContexts.

Here is an example of how getLifecycleCustomContexts can be used to add a new custom context to be sent with lifecycle events:

// Create a Map of the data you want to include...
Map<String, String> dataMap = new HashMap<>();
dataMap.put("movie_name", "solaris");
dataMap.put("poster_country", "JP");
dataMap.put("poster_year", "1978");

// Now create your SelfDescribingJson object...
SelfDescribingJson context1 = new SelfDescribingJson("iglu:com.acme/movie_poster/jsonschema/2-1-1", dataMap);

// Now add this JSON into a list of SelfDescribingJsons...
List<SelfDescribingJson> contexts = tracker.getLifecycleCustomContexts();
contexts.add(context1);

2. Fixing a bug in the lifecycle tracking

This release fixes a bug that stopped Android lifecycle tracking whenever an activity is destroyed, due to the LifecycleHandler callbacks being unregistered on activity destruction.

For more information on this, please see issue #266.

3. Documentation

You can find the updated Android Tracker documentation on our wiki.

You can find the full release notes on GitHub as Snowplow Android Tracker v0.8.0 release.

4. Getting help

For help on integrating the tracker please have a look at the setup and integration guides.

If you have any questions or run into any problems, please visit our Discourse forum. As always, do raise any bugs in the Android Tracker’s issues on GitHub.

For more details on this release, please check out the release notes on GitHub.