Monday, 10 April 2017
Admob Integration - Step 5
5
Enter the
required details to add an app to the list. You should already know the
application name and the package name for your application. Therefore
write the name of your application in the app name field, and write the
android package URL as market://details?id=<Package name>. Enter
your package name by replacing the <Package name >. For category
select what type of app your application is, and write a small
description in the description box to tell what type of app it is. There
is also an option to include Google ads, which can be useful to get ad
fills when AdMob ads are not displayed.
Admob Integration - Step 12
12
Once the SDK is added to your project, open the AndroidManifest.xml file located in your project.
In order to use AdMob in your application you must include the
following xml Just before the </application> tag enter a new
activity for com.google.ads.AdActivity by adding this xml.<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
/>”
Admob Integration - Step 15
15
Finally, to add an AdMob advertisement to your application, open your desired layout xml file.
For this tutorial we will just add it to our main.xml located under
res/layout folder of our project. Then add this following xml where you
like to show your ad in your layout.
- In <LinearLayout> tag add xmlns:ads= "http://schemas.android.com/apk/lib/com.google.ads" After the <LinearLayout> tag add <com.google.ads.AdView android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" ads:adSize="BANNER" ads:adUnitId="YOUR PUBLISHER ID" ads:loadAdOnCreate="true" > </com.google.ads.AdView>
Subscribe to:
Posts (Atom)
-
5 Enter the required details to add an app to the list. You should already know the application name and the package name for your...
-
6 Once you hit continue, AdMob will add your application to the list and ask you to download the AdMob Android SDK. Click on t...















