Last active
August 29, 2015 14:02
-
-
Save Phonbopit/56d969fbc7cb07492efd to your computer and use it in GitHub Desktop.
Sample Admob Link: http://devahoy.com/2014/06/making-money-on-android-with-admob
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:ads="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" > | |
<ImageView | |
android:id="@+id/imageView" | |
android:layout_width="240dp" | |
android:layout_height="240dp" | |
android:layout_centerInParent="true" | |
android:src="@drawable/ic_launcher" /> | |
<com.google.android.gms.ads.AdView android:id="@+id/adView" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
ads:adUnitId="YOUR_AD_UNIT_ID" | |
android:layout_alignParentBottom="true" | |
ads:adSize="SMART_BANNER"/> | |
</RelativeLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AdView adView = (AdView) rootView.findViewById(R.id.adView); | |
AdRequest adRequest = new AdRequest.Builder() | |
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR) | |
.build(); | |
adView.loadAd(adRequest); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.devahoy.sample.admob" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<uses-permission android:name="android.permission.INTERNET"/> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> | |
<uses-sdk | |
android:minSdkVersion="10" | |
android:targetSdkVersion="18" /> | |
<application | |
android:allowBackup="true" | |
android:icon="@drawable/ic_launcher" | |
android:label="@string/app_name" | |
android:theme="@style/AppTheme" > | |
<activity | |
android:name=".MainActivity" | |
android:label="@string/app_name" > | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
</activity> | |
<meta-data android:name="com.google.android.gms.version" | |
android:value="@integer/google_play_services_version"/> | |
<activity android:name="com.google.android.gms.ads.AdActivity" | |
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> | |
</application> | |
</manifest> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment