Java 谷歌游戏服务AdMob
我试图在我的应用程序中包含广告,我创建了AdMob帐户,遵循教程(下载API,将google play services/libraries/google-play-services_lib导入工作区,在Java构建路径/库中,我导入了google-play-services_lib/libs/google play services,并选中Java构建路径/顺序和导出中的字段) 在我的项目中,我做到了 布局活动菜单Java 谷歌游戏服务AdMob,java,android,admob,adview,Java,Android,Admob,Adview,我试图在我的应用程序中包含广告,我创建了AdMob帐户,遵循教程(下载API,将google play services/libraries/google-play-services_lib导入工作区,在Java构建路径/库中,我导入了google-play-services_lib/libs/google play services,并选中Java构建路径/顺序和导出中的字段) 在我的项目中,我做到了 布局活动菜单 <RelativeLayout xmlns:android="
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent" >
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adUnitId="ca-app-pub-xxxxxxxxxxxxx/xxxxxxxx"
ads:adSize="BANNER"
/>
当我运行我的应用程序时,我可以看到广告出现了,但我很少收到警告
01-10 12:29:04.269: W/dalvikvm(2450): VFY: unable to resolve instance field 35
01-10 12:29:04.289: W/GooglePlayServicesUtil(2450): Google Play services is missing.
01-10 12:29:15.319: W/GooglePlayServicesUtil(2450): Google Play services is missing.
和错误
01-10 12:29:15.359: E/GooglePlayServicesUtil(2450): GooglePlayServices not available due to error 1
所以,尽管我犯了错误,但我已经看过我的广告好几次了,但当我检查AdMob帐户时,它显示我的浏览量为0。这是因为我还没有发布我的应用程序,还是我必须做更多的事情?这是什么错误
编辑:
AdMob站点刷新了,现在我看到45个我的视图,但没有钱,这些广告是PPC还是处于测试模式?我可以将它们更改为PPV吗?我不知道您的情况下的确切问题是什么,但我做了以下操作,效果很好
AdView adView = new AdView(this, AdSize.SMART_BANNER, "a152c65f562hc48b");
AdRequest request = new AdRequest();
adView.loadAd(request);
// Add the adView to it
layout.addView(adView); //layout is a RelativeLayout.
// // Initiate a generic request to load it with an ad
adView.loadAd(new AdRequest());
你添加了正确的AdMob密钥吗?你的意思是ads:adUnitId=“ca-app-pub-xxxxxxxxxxxx/xxxxxxxx”?我把整件事都放在了我的出版商idyeah上,它应该是单位Id,但不是那么长的字符串。我的AdMob帐户上写着“identifikator jednostki reklamowej:ca-app-pub-32317428418528835/8488524303”我知道ca-app-pub-3231742841852835是我的出版商号码,所以我应该把它减少到8488524303吗?哦,AdMob网站刷新了,现在我看到45个我的观点,但没有钱,这些广告是PPC还是处于测试模式?我能以某种方式将它们更改为PPV吗?
AdView adView = new AdView(this, AdSize.SMART_BANNER, "a152c65f562hc48b");
AdRequest request = new AdRequest();
adView.loadAd(request);
// Add the adView to it
layout.addView(adView); //layout is a RelativeLayout.
// // Initiate a generic request to load it with an ad
adView.loadAd(new AdRequest());