C. Other Functions

1) TnkSession.queryPublishState()

When you stop publishing ads, no ads will not be displayed in offerwall. For good user experience, you had better hide offerwall buttons when your app is not in publishing state. This method inquiries current state of your app in async way.

  - void TnkSession.queryPublishState(Context context, boolean showProgress, ServiceCallback callback)

   This method returns current state of your app. This method works asynchronously and delivers return values to ServiceCallback object you passed in. You should invoke this method in main UI thread. Return value is delivered to the second parameter of onReturn(Context context, Object result) method of callback object. Callback is executed in main UI thread.

 Parameter  Description
 context Activity or Context object 
 showProgress  shows progress dialog or not.

 callback  ServiceCallback object in which return value is delivered. Return value is an Integer object representing publishing state. TnkSession.STATE_YES (1) means your apps is in publishing state.

Sample Code

final Button button = (Button)findViewById(R.id.main_ad);

// ... 

TnkSession.queryPublishState(this, false, new ServiceCallback() {


    public void onReturn(Context context, Object result) {

        int state = (Integer)result;

        if (state == TnkSession.STATE_YES) {





2) TnkSession.enableLogging()

Turn on or off SDK's logging output.

  - void TnkSession.enableLogging(boolean trueOrFalse)