Question

Is there any third party library for advertising other than Adtech.I want to know how to integrate it with android application as I am not getting proper information about it.

Was it helpful?

Solution

<LinearLayout

                android:id="@+id/ad_container_layout"

                android:layout_width="match_parent"

                android:layout_height="wrap_content"

                android:layout_alignParentBottom="true"

                android:gravity="center_vertical|center_horizontal"

                android:visibility="gone" >



                <com.adtech.mobilesdk.publisher.view.AdtechBannerView

                    android:id="@+id/ad_container"

                    android:layout_width="320dip"

                    android:layout_height="50dip" >

                </com.adtech.mobilesdk.publisher.view.AdtechBannerView>

            </LinearLayout>







private void initializeAds() {

              adtechView = (AdtechBannerView) findViewById(R.id.ad_container);

              if(adtechView != null){

                     AdtechAdConfiguration adtechAdConfiguration = new AdtechAdConfiguration(

                                  "ktmob");

                     adtechAdConfiguration.setAlias("your alias");

                     adtechAdConfiguration.setDomain("a.adtech.de");

                     adtechAdConfiguration.setNetworkId(your network id);

                     adtechAdConfiguration.setSubnetworkId(your subnetwork id)

                     adtechView.setAdConfiguration(adtechAdConfiguration);



                     AdtechBannerViewCallback adTechViewCallback = new AdtechBannerViewCallback() {



                           @Override

                           public void onAdSuspend() {

                                  /*

                                  * This method is called to inform that the application should

                                   * suspend its job, when the advertisement has been resized and

                                  * covers the whole screen. <p> This might be useful in

                                  * applications like games, or applications having video

                                  * play-back.

                                  */

                           }



                           @Override

                           public void onAdSuccess() {


                                  }



                                  /*

                                  * This method is called when an ad was downloaded successfully.

                                  */

                           }



                           @Override

                           public void onAdResume() {

                                  /*

                                  * This method is called when the application has been resumed

                                  * from the suspended state.

                                  */

                           } 



                           @Override

                           public void onAdLeave() {

                                  /*

                                  * This method is called when the current application is left

                                  * because the user clicked a banner which will be opened in a

                                  * the external browser.

                                  */

                           }



                           @Override

                           public void onAdFailure() {




                                  }

                                  /*

                                  * This method is called when an ad download failed. This could

                                  * happen because of networking reasons or other server

                                  * communication reasons.

                                  */

                           }



                           @Override

                           public void onAdDefault() {

                                  /*

                                  * This method is called when the default ad is loaded in the

                                  * {@link AdtechBannerView} container.

                                  */

                           }



                           @Override

                           public void onCustomMediation() {



                           }



                           @Override

                           public boolean shouldInterceptLandingPageOpening(String url,

                                         NonModalLandingPageHandlerCallback callback) {

                                  return false;

                           }



                           @Override

                           public BannerResizeBehavior onAdWillResize(

                                         BannerResizeProperties resizeProperties) {

                                  return null;

                            }



                           @Override

                           public void onAdDidResize(BannerResizeProperties resizeProperties) {



                           }

                     };



                     adtechView.setViewCallback(adTechViewCallback);



                     SDKLogger.setLogLevel(SDKLogLevel.OFF);

              }



       }

with this changes adtech should work thanks.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top