Skip to content
Pedro Filipe edited this page Apr 4, 2016 · 2 revisions

The adjust sdk is an open source plugin for mobile apps that supports our solution, find more about it at adjust.com.

What is an SDK?

It's a plugin that you integrate with your app.

Why do I need the adjust SDK

Mostly to track installs, sessions and events of your app and you can see them at adjust.com.

Aims of the adjust SDK

  • Open source - Anyone can review, fork and propose changes to the SDK.
  • Non-blocking - Do as much as possible in the background without using the calling thread.
  • Fault-tolerant - Be able to recover from app or device close/crash.
  • Low memory size - The compiled size of the SDK version 4.7.0 in an example app was XXX mb.
  • Testable - Anyone can review and test the features of the SDK.

Overview

[Design of the handlers]

Adjust/AdjustInstance

Adjust is a static class and the common entry point for all of the functionalities of the SDK. It manages the access to a singleton instance of the AdjustInstance class. The only current exception is the feature to get the Google Advertising Id. It is not a feature related to the adjust SDK and just an helper function for the user.

The AdjustInstance class has several purposes:

  • Create and save the Activity Handler instance.
  • Redirect calls from Adjust to the Activity Handler instance.
  • Check if the Activity Handler has been initialized before redirecting calls.
  • Save some state before the Activity Handler is initialized.

The separation of the Adjust and AdjustInstance class is intended to have the possibility of mocking the access to the SDK with the non-static class AdjustInstance, while having the convenience of using the SDK thru a static class like Adjust.

AdjustConfig

AdjustConfig is the class that contains the configuration of the SDK before it is started. It also performs validity checks to it's mandatory fields:

  • Context - Android instance to access all the application-specific resources.
  • App token - 12 character String that identifies the app in the backend.
  • Environment - Constant "sandbox" or "production" that indicates to the backend which environment the SDK is running. sandbox for tests, production for released apps.

The remaining configuration are not checked in AdjustConfig, but inside Activity handler.

AdjustEvent

AdjustEvent is the class that contains the configuration of the events to track. It only contains one mandatory:

  • Event token - a 6 character String that identifies the event in the backend.

Unlike AdjustConfig, all of its configurations are checked inside AdjustEvent.