除了Adtech之外,是否有任何第三方图书馆用于广告。我想知道如何将其与Android应用程序集成,因为我没有得到有关它的正确信息。
答案 0 :(得分:1)
<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);
}
}
有了这些变化,adtech应该感谢。