1.2 Android Integration

1) Show More Apps

 Popup a non-incentive offerwall view.

Method
  - void TnkSession.popupMoreApps(Activity activity)
  - void TnkSession.popupMoreApps(Activity activity, String title)
  - void TnkSession.popupMoreApps(Activity activity, String title, TnkAdListener listener)

Parameters
Name  Description
 activity Activity object 
 title Title displayed on header area.
 (Default : Today's apps) 
 listener  TnkAdListener object

Sample Code

@Override

public void onCreate(Bundle savedInstanceState) {

    // ...

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

    button.setOnClickListener(new OnClickListener() {

        @Override

        public void onClick(View v) {

            TnkSession.showMoreApps(MainActivity.this);

        }

    });


2) Show More Apps on exit

Popup a non-incentive offerwall view with two buttons at bottom. You have to implement TnkAdListener logic to exit app when users click 'Exit' button in the offerwall.

Method
  - void TnkSession.showMoreAppsWithButtons(Activity activity, String title, String closeText, String exitText, TnkAdListener listener)

Parameters
 Name  Description
 activity Activity object 
 title Title displayed on header area.
 (Default : Today's apps) 
 closeText Title of left button for cancel.
 exitText Title of right button for exit.
 listener  TnkAdListener object

Sample Code

    @Override

    public void onBackPressed() {

        TnkSession.showMoreAppsWithButtons(this, "Hot Free Apps!", "Cancel", "Quit"new TnkAdListener() {

                    @Override

                    public void onClose(int type) {

                        if (type == TnkAdListener.CLOSE_EXIT) {

                            MainActivity.this.finish();

                        }

                    }


                    @Override

                    public void onShow() {

                    }


                    @Override

                    public void onFailure(int errCode) {

                    }

                    @Override

                    public void onLoad() {

                    }

  });

    }


3) Show Interstitial Ads

See 4. Interstitial Ad for detail.
Comments