com.adjust.sdk
Class Adjust

java.lang.Object
  extended by com.adjust.sdk.Adjust

public class Adjust
extends Object

The main interface to Adjust.

Use the methods of this class to tell Adjust about the usage of your app. See the README for details.


Constructor Summary
Adjust()
           
 
Method Summary
static void appDidLaunch(android.app.Activity activity, String appToken, String environment, String logLevel, boolean eventBuffering)
           
static void appWillOpenUrl(android.net.Uri url)
           
static Boolean isEnabled()
          Check if the SDK is enabled or disabled
static void onPause()
          Tell Adjust that an activity will pause.
static void onResume(android.app.Activity activity)
          Tell Adjust that an activity did resume.
static void setEnabled(Boolean enabled)
          Enable or disable the adjust SDK
static void setOnFinishedListener(OnFinishedListener listener)
           
static void setSdkPrefix(String sdkPrefix)
           
static void trackEvent(String eventToken)
          Tell Adjust that a particular event has happened.
static void trackEvent(String eventToken, Map<String,String> parameters)
           
static void trackRevenue(double amountInCents)
          Tell Adjust that a user generated some revenue.
static void trackRevenue(double amountInCents, String eventToken)
           
static void trackRevenue(double amountInCents, String eventToken, Map<String,String> parameters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Adjust

public Adjust()
Method Detail

onResume

public static void onResume(android.app.Activity activity)
Tell Adjust that an activity did resume.

This is used to initialize Adjust and keep track of the current session state. Call this in the onResume method of every activity of your app.

Parameters:
activity - The activity that has just resumed.

onPause

public static void onPause()
Tell Adjust that an activity will pause.

This is used to calculate session attributes like session length and subsession count. Call this in the onPause method of every activity of your app.


setOnFinishedListener

public static void setOnFinishedListener(OnFinishedListener listener)

trackEvent

public static void trackEvent(String eventToken)
Tell Adjust that a particular event has happened.

In your dashboard at http://adjust.io you can assign a callback URL to each event type. That URL will get called every time the event is triggered. On top of that you can pass a set of parameters to the following method that will be forwarded to these callbacks.

Parameters:
eventToken - The Event Token for this kind of event. They are created in the dashboard at http://adjust.io and should be six characters long.
parameters - An optional dictionary containing the callback parameters. Provide key-value-pairs to be forwarded to your callbacks.

trackEvent

public static void trackEvent(String eventToken,
                              Map<String,String> parameters)

trackRevenue

public static void trackRevenue(double amountInCents)
Tell Adjust that a user generated some revenue.

The amount is measured in cents and rounded to on digit after the decimal point. If you want to differentiate between several revenue types, you can do so by using different event tokens. If your revenue events have callbacks, you can also pass in parameters that will be forwarded to your end point.

Parameters:
amountInCents - The amount in cents (example: 1.5 means one and a half cents)
eventToken - The token for this revenue event (optional, see above)
parameters - Parameters for this revenue event (optional, see above)

trackRevenue

public static void trackRevenue(double amountInCents,
                                String eventToken)

trackRevenue

public static void trackRevenue(double amountInCents,
                                String eventToken,
                                Map<String,String> parameters)

setEnabled

public static void setEnabled(Boolean enabled)
Enable or disable the adjust SDK

Parameters:
enabled - The flag to enable or disable the adjust SDK

isEnabled

public static Boolean isEnabled()
Check if the SDK is enabled or disabled


appWillOpenUrl

public static void appWillOpenUrl(android.net.Uri url)

appDidLaunch

public static void appDidLaunch(android.app.Activity activity,
                                String appToken,
                                String environment,
                                String logLevel,
                                boolean eventBuffering)

setSdkPrefix

public static void setSdkPrefix(String sdkPrefix)


Copyright © 2014. All Rights Reserved.