0
我試圖在自己的應用上放置廣告,但由於某種原因,廣告橫幅無效,因爲插頁式廣告的確有效,所以這是有線的。Android AdMob Banner無法正常工作
這裏是我的xml:
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/textView1"
android:layout_alignLeft="@+id/fartDisplay"
ads:adSize="BANNER"
ads:adUnitId="My-Ad-Unit-Id" >
</com.google.android.gms.ads.AdView>
,這裏是我的Java代碼:
private AdView mAdView;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_fart);
mAdView = (AdView) findViewById(R.id.adView);
mAdView.loadAd(new AdRequest.Builder().build());
}
IM也對logcat的得到這個:
09-04 19:34:54.919: E/GooglePlayServicesUtil(2841): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
09-04 19:34:54.929: E/GooglePlayServicesUtil(2841): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
我有元數據,而我改變單位ID爲字符串,所以它不會是可見的,即時通訊使用Eclipse,Gradle只在android工作室沒有? – Pachu 2014-09-04 16:57:28
對Eclipse IDE執行以下步驟https://developers.google.com/mobile-ads-sdk/docs/admob/android/quick-start – Psypher 2014-09-04 18:11:15