Witajcie. Mam problem z wyświetlaniem reklam admob. Na emulatorze normalnie widoczny jest banner, a gdy wgram apke na telefon to nic nie widać. Projekt jest robiony a Android studio. Wie ktoś gdzie może być problem. Pierwszy raz mam styczność z reklamami więc nie mogę poradzić sobie z problemem :E . Poniżej wklejam fragmenty kodu które dałem żeby reklama był w aplikacji. Proszę o pomoc 😃 pozdrawiam.
W manifeście:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="aplikacja"
android:theme="@style/AppTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
....
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
w build.gradle w app:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
}
w activity_main.xml:
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
w MainActivity.java:
//dodane zeby działało
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
..
//w onCreate, pod setContentView(R.layout.activity_main);
AdView adView = (AdView)this.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);