Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Did you add permissions and congifchanges of admob in your menifest. Cause i have run your code and it displayed in my emulator. And also in order to display add your app's targetSdkVersion need to be greater then 14.</p> <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt; &lt;activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" &gt; &lt;/activity&gt; </code></pre> <p>Activity is as like you</p> <pre><code>public AdView admobView; public View mainView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); admobView = new AdView(this, AdSize.BANNER, "a14f39f0b52dce6"); RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); lp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); admobView.setLayoutParams(lp); //mainView.setLayoutParams(lp); RelativeLayout layout = new RelativeLayout(this); AdRequest adRequest = new AdRequest(); //tested this adRequest.addTestDevice(AdRequest.TEST_EMULATOR); // Emulator //tested this //adRequest.addTestDevice("20cb18e8ffc74ad2"); //tested this //adRequest.addMediationExtra("3d879f364d5747c5", null); admobView.loadAd(adRequest); layout.addView(admobView); //layout.addView(mainView); setContentView(layout); } </code></pre> <p>And Manifest is == </p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.ee" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name=".MainActivity" android:label="@string/title_activity_main" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" &gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload