I am having the Admob problem its working fine with test AppId and AdUnitId on emulator and real device. both the devices show the "Nice Job" test Ads
After creating my AppId and My AdUnitId the emulator is showing next level ads and working but the real device don't show anything. no adview bar in the real device
My codes are as below-
build.gradle ModuleApp
dependencies { ...
implementation 'com.google.android.gms:play-services-ads:18.3.0' }
AndroidManifest.xml
<application ... <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="@string/xsAdmobMyAppId"/> </application>
activity_current.xml
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:adSize="BANNER"
app:adUnitId="@string/xsAdmobMyBannerUnitId">
</com.google.android.gms.ads.AdView>
CurrentActivity.java inside onCreate()
MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {
}
});
AdView mAdView = findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
.build();
mAdView.loadAd(adRequest);
One more query: It is shown in the developers.google.com get started information to add the MobileAds.initialize{...} What is the requirement of this, as the app is working still working even if the code is not added.
I found some similar questions on the web but didn't find/understand the proper solution.