Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,807,727 Members 52,379 Now Online
XDA Developers Android and Mobile Development Forum

[Q] How to insert admob in app help me

Tip us?
 
Mario7795
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 1
Join Date: Apr 2014
Unhappy [Q] How to insert admob in app help me

hi guys
could you help me to put the banner in my app.
I also followed the guides but I still can not insert
You might even see me lines of code please
thanks
 
amank22
Old
#2  
amank22's Avatar
Junior Member
Thanks Meter 5
Posts: 23
Join Date: Jan 2013
Location: greater noida
what problem are you getting????
Do what you like.
Try what you can't do.
Have patients.
Keep Trying.
 
coolbud012
Old
#3  
coolbud012's Avatar
Senior Member
Thanks Meter 24
Posts: 202
Join Date: Sep 2012
Location: Bangalore
Atleast tell the problem or provide the code where you are facing problem.

Aptitude Cracker - An Application for all Competitive Exams and all In One Aptitude Preparation
---------------------------------------------------------------------------------------------------------------------------------
DroidAcid - Get all android tutorials and Micromax CanvasHD A116 guides.
 
GRYMALA
Old
#4  
Junior Member
Thanks Meter 6
Posts: 19
Join Date: May 2014
Simple:
1) Install Google AdMob Ads SDK (you can use Android SDK Manager for that)
2) Add GoogleAdMobAdsSdk.jar to your project (Project Properties>>Java Build Path>>Add External JARs…)
3) In the Manifest add ACCESS_NETWORK_STATE and INTERNET permissions, and also an activity inside application tag, like that:

Code:
<uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:debuggable="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".BillingSampleActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:name="com.google.ads.AdActivity" />
    </application>
4) Get Publisher ID from AdMob
5) Add banner to your layout
Code:
<com.google.ads.AdView
     android:id="@+id/adView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            ads:adSize="BANNER"
            ads:adUnitId="your_admob_publisher_id"
            ads:loadAdOnCreate="true" />

Thats it!
 
AMQTech
Old
#5  
Junior Member
Thanks Meter 43
Posts: 24
Join Date: Jul 2014
Location: Yorba Linda
Quote:
Originally Posted by GRYMALA View Post
Simple:
1) Install Google AdMob Ads SDK (you can use Android SDK Manager for that)
2) Add GoogleAdMobAdsSdk.jar to your project (Project Properties>>Java Build Path>>Add External JARs…)
3) In the Manifest add ACCESS_NETWORK_STATE and INTERNET permissions, and also an activity inside application tag, like that:

Code:
<uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:debuggable="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".BillingSampleActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:name="com.google.ads.AdActivity" />
    </application>
4) Get Publisher ID from AdMob
5) Add banner to your layout
Code:
<com.google.ads.AdView
     android:id="@+id/adView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            ads:adSize="BANNER"
            ads:adUnitId="your_admob_publisher_id"
            ads:loadAdOnCreate="true" />

Thats it!
Nice answer! Thanks for this.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes