0
Good afternoon, I’m making an app and I’m setting up the ads part using google admob, but when I put my ad ID does not appear in my app, it appears only with the test ID. I’m using an emulator to use android. And my ad blocks have been created for a long time. Do I need to publish my app to the play store for the ads to appear? Or my code is wrong?
// Code Androidmanifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-4462240214744405~5342560161" />
//Codigo Java
private AdRequest mAdRequest;
private AdView mAdView;
//Carregamento ad
MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {
}
});
//ad
AdView adView = new AdView(this);
adView.setAdSize(AdSize.BANNER);
adView.setAdUnitId("ca-app-pub-4462240214744405/1315856688");
mAdView =findViewById(R.id.adView1);
mAdRequest = new AdRequest.Builder().build();
mAdView.loadAd(mAdRequest);
//Layout
<com.google.android.gms.ads.AdView
android:id="@+id/adView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
app:adSize="BANNER"
app:adUnitId="ca-app-pub-4462240214744405/1315856688"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"></com.google.android.gms.ads.AdView>
Good evening, I understand what you said, but where do I see if you’ve been checked or not? in my email has nothing to say, and when I opened the payment settings I could not put the way I will receive payments, because I need to achieve the minimum amount.
– Yuri Leite
The email you will only receive a few days later, when your account is approved. I put more information in my original reply.
– vegidio
So I did what you said and I’ll post a print there to see how this now.
– Yuri Leite
Aside from the fact that you put your screenshot in another answer, it seems you did everything right; now it’s wait. And if my answer helped you then mark it as correct.
– vegidio
So, my account was approved and appeared the same as in your print, but the ads did not appear in the app, in case I use an emulator to debug the app, I would have to install the app on a mobile phone?
– Yuri Leite
I went to look at the Logcat, and it’s giving an error in the ad , the error number is 3, do you know what it might be? Is it lack of request?
– Yuri Leite