Я только что добавил новый сайт на Admod, и он работает как новый, Android, а новый - GoogleAdMobsdk. Я выполнил код примера googles, за исключением того, что я установил флаг тестирования в true. Ну, это было сначала, все взволнованы, что это сработало, но когда я снова запустил его, он не появился. Похоже, что объявление появляется меньше половины времени. Я знаю, что это было бы нормально, если бы не тестирование мод. Должна ли реклама allwys появляться, если флаг тестирования верен? кодAdmob ad появляется меньше, чем 1/2 времени, в то время как в тестовом режиме, используя новый admob sdk
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
View mCall = findViewById(R.id.call);
mCall.setOnClickListener(this);
View mAbout = findViewById(R.id.about);
mAbout.setOnClickListener(this);
View mWhatWeDo = findViewById(R.id.whatwedo);
mWhatWeDo.setOnClickListener(this);
View mEmail = findViewById(R.id.email);
mEmail.setOnClickListener(this);
View mMap = findViewById(R.id.map);
mMap.setOnClickListener(this);
// Create the adView
// Create the adView
AdView adv = new AdView(this, AdSize.BANNER, "a14d84be1abee56");
// Lookup your LinearLayout assuming it’s been given
// the attribute android:id="@+id/mainLayout"
LinearLayout layout = (LinearLayout)findViewById(R.id.mainLayout);
// Add the adView to it
layout.addView(adv);
// Initiate a generic request to load it with an ad
AdRequest t=new AdRequest();
t.setTesting(true);
adv.loadAd(t);
}
расположение:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:background="#ff00ffff"
android:layout_height="fill_parent"
>
<LinearLayout
android:id="@+id/mainLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/header"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="8px" />
<Button
android:id="@+id/about"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Who we are"
android:textStyle="bold"
android:textColor="#ffff00ff" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="6px" />
<Button
android:id="@+id/whatwedo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#ffff00ff"
android:text="What we do" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="6px" />
<Button
android:id="@+id/call"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#ffff00ff"
android:text="Call Us" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="6px"
android:text="" />
<Button
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#ffff00ff"
android:text="Driving Directions" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="6px"
android:text="" />
<Button
android:id="@+id/email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#ffff00ff"
android:text="Email Us" />
</LinearLayot>