在使用 admob 广告进行 Beta 测试时使用实时广告
Using live ads while beta testing with admob ads
我刚刚发布了我的 android 应用测试版。在开发应用程序时,我将代码设置为将广告设置为测试,但是当我将代码更改为 google 所说的用于开发时,广告不会显示。这仅仅是因为测试版中没有实时广告,还是我的代码没有显示广告。这是我的代码...
主要活动
AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
XML...
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
app:adSize="SMART_BANNER"
ads:adUnitId="@string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>
AndroidManifest
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
感谢任何帮助。谢谢:)
我没有发现您的代码有任何问题。一切似乎都是正确的。问题可能与您正在使用的 ads:adUnitId
有关。尝试在此处 http://www.google.com/ads/admob/
创建关于 AdMob 的新 ads:adUnitId
和 check.See 详细信息
希望对您有所帮助。
我刚刚发布了我的 android 应用测试版。在开发应用程序时,我将代码设置为将广告设置为测试,但是当我将代码更改为 google 所说的用于开发时,广告不会显示。这仅仅是因为测试版中没有实时广告,还是我的代码没有显示广告。这是我的代码...
主要活动
AdView mAdView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
XML...
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
app:adSize="SMART_BANNER"
ads:adUnitId="@string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>
AndroidManifest
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
感谢任何帮助。谢谢:)
我没有发现您的代码有任何问题。一切似乎都是正确的。问题可能与您正在使用的 ads:adUnitId
有关。尝试在此处 http://www.google.com/ads/admob/
ads:adUnitId
和 check.See 详细信息
希望对您有所帮助。