apply plugin: 'com.android.application'
android { compileSdkVersion 21 buildToolsVersion "21.1.1"
defaultConfig { applicationId "com.example.yamkatrader.myapplication" minSdkVersion 9 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' debuggable false } }}
dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:21.0.2' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.google.api-ads:tools:1.12.1'} <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> </activity><?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.yamkatrader.myapplication" > <uses-permission android:name="android.permission.SET_DEBUG_APP"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <application
android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/Theme.AppCompat.Light" > <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:id="@+id/RelativeLayout"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
android:background="#ff6b6b76"
android:theme="@style/Theme.AppCompat.Light">
<com.google.android.gms.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="ca-app-pub-4820038314180872/2219406344"
ads:adSize="BANNER"
android:layout_below="@+id/inputSearch"
android:layout_centerHorizontal="true"
android:layout_marginTop="37dp" />
<EditText android:id="@+id/inputSearch"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/search"
android:inputType="textVisiblePassword"/>
<ListView
android:id="@+id/list_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="59dp" />
</RelativeLayout>
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
adView = new AdView(this);
adView.setAdUnitId("ca-app-pub-4820038314180872/2219406344");
adView.setAdSize(AdSize.BANNER);
RelativeLayout layout = (RelativeLayout)findViewById(R.id.RelativeLayout);
layout.addView(adView);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
Dear Jeremie
refer to below .
/***************************************************************************/
/****** Please Put below Source in your Code using Copy and
paste *******/
/***************************************************************************/
<!--
------------------------------------------------------------------ -->
<!-- 1. Content of Android Manifest.xml
---------------------------- -->
<!--
------------------------------------------------------------------ -->
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|uiMode|screenLayout|screenSize|smallestScreenSize"
/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<!-- ------------------------------------------------------------------
-->
<!--
------------------------------------------------------------------ -->
<!--
------------------------------------------------------------------ -->
<!-- 2. Content of main.xml
---------------------------------------- -->
<!--
------------------------------------------------------------------ -->
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="MY_AD_UNIT_ID" />
<!-- ------------------------------------------------------------------
-->
<!--
------------------------------------------------------------------ -->
/*****************************************************************************/
/****** Please Put below Function in your Code using Copy and
paste *******/
/*****************************************************************************/
/*** 3.1 Call Function in a Active Function
******************************/
SystemAdvertisementView();
/*** 3.2 Function Body ***************************************************/
AdView mAdverView;
public void SystemAdvertisementView() {
mAdverView
=(AdView)findViewById(R.id.adView);
if( mAdverView == null ) {
System.out.println("No Advertisement"); }
AdRequest adRequest = new
AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("AC98C820A50B4AD8A2106EDE96FB87D4")
.build();
mAdverView.loadAd(adRequest);
}
@Override
protected void onPause() {
mAdverView.pause();
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
mAdverView.resume();
}
/*** 3.3 Must call when you finish Activity or Ad
************************/
mAdverView.destroyDrawingCache();
mAdverView.destroy();
To post to this group, send email to google-adm...@googlegroups.com.--
---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/a1ysV38w4bY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
....
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<uses-feature android:name="android.hardware.camera"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<permission android:name="android.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/myapp"
android:theme="@style/AppTheme" >
<uses-library android:name="com.google.android.maps"/>
<activity
android:name=".defens"
android:label="@string/myapp" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".appel"
android:label="@string/myapp"
>
</activity>
<activity
android:name=".MapsActivity"
android:label="@string/myapp"
>
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout"/>
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="mykey"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
</application>
</manifest>--
--