2.2 Android Integration

Before proceeding this chapter, be sure that you already finished SDK settings. If not, check  [3) Android Settings] first.

APIs for non-incentive advertising are identical to those for incentive advertising.

[CPE Advertising]

Users are attributed when they install and launch advertising apps.
Add following code in your first activity's onCreate() method.

Method
  - void TnkSession.applicationStarted(Context context)

Description
   Invoke this method as soon as your app is started. This method is executed in a background thread.
   * This method also collects analytics data. If you don't want this, you can turn it off. See 5. Analytics Report

Parameters
 Name Description
 contextActivity or Context object 

Sample code

@Override

public void onCreate(Bundle savedInstanceState) {

    // ...

    TnkSession.applicationStarted(this);

}



[CPA Advertising]

Users are attributed when they complete predefined mission such as 'login completed', 'signed up' or 'tutorial finished'.

Method
  - void TnkSession.actionCompleted(Context context)

Description
   Invoke this method when a user completes predefined mission. This method is executed in a background thread.

Parameters
 Name Description
 contextActivity or Context object 

Sample code

public void whenYourActionIsCompleted() {

    // ...

    TnkSession.actionCompleted(this);

}

Comments