簡體   English   中英

Google廣告會顯示在模擬器上,而不顯示在市場上購買了應用程序的手機上嗎?

[英]Google ads showing up on emulator, but not on phones that bought app on market?

我在市場上有一個應用程序,最近我決定向其中添加Google Ads。 我會直截了當。 模擬器上的示例廣告效果完美,但在我購買應用程序的atrix上卻沒有顯示。 這是我的.xml廣告和清單。 另外,我不會調用.java中的廣告,因為我將其設置為自動獲取.xml中的廣告。 另外,在admob網站上,我將“自動刷新”設置為“開”,並且啟用了其他Google廣告。 也沒有過濾器。 救命??


<com.google.ads.AdView 
                    android:id="@+id/adView"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_below="@id/logo"
                     ads:adUnitId=""
                     ads:adSize="BANNER"
                     ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"
                     ads:loadAdOnCreate="true">

</com.google.ads.AdView>

 <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

 <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

您是否在應用程序中包含alphanumeric廣告代碼?

如果您仍然無法實施廣告,可以嘗試使用此鏈接

您的Atrix是否扎根? 許多開發人員在其ROM中添加了廣告阻止程序。

我不確定出什么問題,但是我對所有應用程序都使用了相同的設置,它在真實和仿真設備中都像一個魅力。 您的清單設置很好。

main.xml中

<LinearLayout
    android:id="@+id/adMob"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center" >
</LinearLayout>

活動:

void adMob() {
    // Create the adView
    AdView adView = new AdView(this, AdSize.BANNER, "XxxxxxxXxxxx"); //admob ID

    AdRequest adRequest = new AdRequest();
    //adRequest.addTestDevice(AdRequest.TEST_EMULATOR); // Emulator
    //adRequest.addTestDevice("6.......7");  // my phone

    // Lookup your LinearLayout assuming it’s been given
    LinearLayout layout = (LinearLayout) findViewById(R.id.adMob);
    layout.removeAllViews();

    // Add the adView to it
    layout.addView(adView);

    // Initiate a generic request to load it with an ad
    adView.loadAd(adRequest);
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM