Create your first android web app with admob banner ads

Android studio Tutorial 2

Step 1

Go to admob





STEP 2

 After Successful Sign up


CLICK THE APPS  TAB



STEP 3

Type your app name
choose your
platform
android
next 
click add button


STEP 4

Creat add unit

STEP 5

CHOOSE BENNER ADD


STEP 6




GO TO ANDROID STUDIO





GO THIS LINK


C0PPY THIS ONE


OPEN ANDROID STUDIO
OPEN  APP LEVEL GRADLE FILE


PASTE  THAT  CODE HERE





COPPY MAIN XML CODE
       
     
     <WebView
        android:id="@+id/WebView1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    </WebView>

    <com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
        android:id="@+id/adView"
        android:layout_width="372dp"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        ads:adSize="BANNER"
        ads:adUnitId="YOUR AD UNIT ID HERE"></com.google.android.gms.ads.AdView>


    

 
 


COPPY
       

            private AdView mAdView;
            private TextView mText;

       
 









COPPY MAIN .JAVA CODE
       

             MobileAds.initialize(this, "YOUR APP ID HERE");
        mAdView = findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().build();
        mAdView.loadAd(adRequest);




        WebView webView = (WebView) findViewById(R.id.WebView1);
        //open browser inside your app
        webView.setWebViewClient(new MyBroswer());
        String url = "https://tipze.blogspot.in/";
        webView.getSettings().setLoadsImagesAutomatically(true);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
        webView.loadUrl(url);


       
 



NEXT GO
PROGECT
APP
SRC
ANDROID_MANIFEST .XML
COPPY THIS CODE
       
<uses-permission android:name="android.permission.INTERNET" />
            

       
 

SCREEN













GO TO BULD 




NEXT










 APP IS REDY WITH ADS
ENJOY





Comments

  1. The amusement analyzer is in charge of examinations of the execution of the diversion and the identification of issues in the gaming gadget that is being produced. neko atsume goldfish guide

    ReplyDelete
  2. I am getting class MyBrowser error what package should I include to resolve the error

    Please bro answer me fast

    ReplyDelete

Post a Comment