I want to display ads banner from admob in my android apps :
what i have :
- In manifest add a activity –
<activity android:name=".AdMobActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>
</application>
2 . In my apps layout –
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content" android:layout_height="wrap_content"
ads:adSize="BANNER" ads:adUnitId="a150095f0ed0554"
ads:loadAdOnCreate="true" > </com.google.ads.AdView>
3 . add the jar file GoogleAdMobAdsSdk-6.1.0.jar .
What is the problem :
Display add banner with a message in red color –
“you must have AdActivity declared in AndroidManifest.xml with with configChanges.”
From the official docs, you’ll need to update the manifest with this activity definition:
and necessary permissions:
You’ll need to set
target=13or higher inproject.propertiesso the project compiles.