[英]How to show Native ads?
I have already implemented admob Reward ads and want to show native ads. 我已经实施了admob奖励广告,并希望展示原生广告。 Really didn't get any useful source and stuck in this problem for 3 days.
确实没有获得任何有用的资源,并且在此问题上停留了3天。 Can any one help me to show native ads please its an emergency issue.
任何人都可以帮助我展示原生广告吗,这是一个紧急问题。
I have tried appodeal also but got so many errors nothing else. 我也尝试过adodeal,但是有很多错误。
Add this to your XML 将此添加到您的XML
<com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="YOUR UNIT ID" />
And this is how you can request for Ads 这就是您可以请求广告的方式
private AdView mAdView;
MobileAds.initialize(this, "Ads Key This is Different from UNIT ID");
mAdView = findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
mAdView.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
Log.e("Add Listener", "AdLoaded");
}
@Override
public void onAdFailedToLoad(int errorCode) {
Log.e("Add Listener", "onAdFailedToLoad" + " - " + errorCode);
}
@Override
public void onAdOpened() {
Log.e("Add Listener", "AdOpened");
}
@Override
public void onAdLeftApplication() {
Log.e("Add Listener", "AdLeft");
}
@Override
public void onAdClosed() {
Log.e("Add Listener", "AdClosed");
}
});
what i have done for my app was implementing an imageview on top of all layouts as a framelayout. 我为我的应用所做的工作是在所有布局的顶部实现imageview作为framelayout。 the idea was using glide and a link that goes into the app.
这个想法是使用glide和进入应用程序的链接。 so what you need is two things
所以你需要做两件事
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.