コード例 #1
0
  private void initAudienceTargetingTagList() {
    List<String> tagList = new ArrayList<String>();

    if (mPreferences != null) {
      String tagString =
          mPreferences.getString(SettingConfig.PREFERENCES_AUDIENCE_TARGETING_TAGS, "");
      tagList.addAll(Arrays.asList(tagString.split(",")));
    }

    I2WAPI.setAudienceTargetingTags(this, tagList);
  }
コード例 #2
0
        @Override
        public void run() {

          //	request the open splash ad here
          //
          // XXX@OpenSplash-request@#OpenSplash-request#
          //	check it for landscape ad case
          //
          if (hasRequestedSplashAd()) {
            return;
          }

          //	we can request the splash ad
          //	after the LOGO shows for some time
          //
          mSplashAd = I2WAPI.requesSingleOfferAD(CEOpenSplashActivity.this, "OPEN_SPLASH");
          // end

          // XXX@OpenSplash-setListener@#OpenSplash-setListener#
          if (mSplashAd != null) {

            //	implement onLoaded, onLoadFailed and
            //	onClosed callback
            //
            mSplashAd.setListener(
                new SplashAdListener() {

                  @Override
                  public void onLoaded() {
                    //	this callback is called
                    //	when the splash ad is ready to show
                    //
                    //	show splash ad here
                    //
                    mSplashAd.show(R.anim.slide_in_from_bottom, R.anim.no_animation);
                  }

                  @Override
                  public void onLoadFailed() {
                    //	this callback is called
                    //	when this splash ad load fail
                    //
                    onSplashAdFinish();
                    startNextActivity();
                  }

                  @Override
                  public void onClosed() {
                    //	this callback is called when:
                    //	1.user click the close button
                    //	2.user press the onBackpress button
                    //	3.dismiss_time setting from the server
                    //
                    onSplashAdFinish();
                    startNextActivity();
                  }
                });
          } else {
            //	the ad is not ready now
            //	start the next activity directly
            //
            startNextActivity();
          }
          // end
        }