The Guide of ‘Blue Whale’ Game challenge

Download The Guide of ‘Blue Whale’ Game challenge

Blue whale Game Downlaod

s1 copy.jpg

 

 

 

Tag:

"bluewhale game","crzay video","wtf video","stupid"

 

Advertisements

Android How to Integrate Google AdMob in your Android App

manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.lalitbaghel.retailapp">


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

    <application

        android:allowBackup="true"
        android:largeHeap="true"
        android:supportsRtl="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/MyTheme">

        <activity
            android:name="com.lalitbaghel.retailapp.ECartHomeActivity"

            android:label="@string/app_name"
            android:screenOrientation="portrait">


        </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"
            android:theme="@android:style/Theme.Translucent" />


    </application>

</manifest>

 

build.gradle  //app wala

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.google.android.gms:play-services-ads:8.4.0'
}

values.xml

<string name="ad_id_banner">ca-app-pub-1062639589929989/1103977551</string>

Mainactivity.java

//Locate the Banner Ad in activity_main.xml
AdView adView = (AdView)findViewById(R.id.banner_AdView);

// Request for Ads
AdRequest adRequest = new AdRequest.Builder()

        // Add a test device to show Test Ads
        .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
                //  .addTestDevice("CC5F2C72DF2B356BBF0DA198")
        .build();

// Load ads into Banner Ads
adView.loadAd(adRequest);

Note if you ant to add ads in your main fragment activity then you use

AdView adView = (AdView)this.findViewById(R.id.banner_AdView);

activitymain.xml

<?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:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.lalitbaghel.retailapp.MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!" />

  <LinearLayout 
      android:layout_width="fill_parent"
     android:layout_height="60dp"
     android:layout_alignParentBottom="true"
     android:layout_gravity="center_horizontal|top"
     android:background="@color/material_blue_500"
     android:orientation="vertical">




        <com.google.android.gms.ads.AdView
        android:id="@+id/banner_AdView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adSize="BANNER"
        ads:adUnitId="@string/ad_id_banner"
        android:layout_gravity="center"/>

 </LinearLayout>

</RelativeLayout>