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 mAdView = (AdView) findViewById(R.id.adView); | |
AdRequest adRequest = new AdRequest.Builder().build(); | |
mAdView.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
xmlns:ads="http://schemas.android.com/apk/res-auto" | |
<com.google.android.gms.ads.AdView | |
android:id="@+id/adView" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_centerHorizontal="true" | |
android:layout_alignParentBottom="true" |
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
<string name="banner_ad_unit_id">ADD YOUR AD UNIT ID HERE</string> |
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
<!-- Include required permissions for Google Mobile Ads to run--> | |
<uses-permission android:name="android.permission.INTERNET"/> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> | |
<!--This meta-data tag is required to use Google Play Services.--> | |
<meta-data android:name="com.google.android.gms.version" | |
android:value="@integer/google_play_services_version" /> | |
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
//add the below line of code in build.gradle dependencies | |
compile 'com.google.android.gms:play-services-ads:7.5.0' |
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
// add this code to the onCreate method of your MainActivity.java File | |
String url ="URL" ; // Replace URL with your website address like this "http://google.com" | |
WebView view = (WebView) this.findViewById(R.id.webView); | |
view.getSettings().setJavaScriptEnabled(true); | |
view.loadUrl(url); |
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
<uses-permission android:name="android.permission.INTERNET"/> //add this code before.... <application |
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: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" | |
tools:context=".MainActivity"> | |
<WebView | |
android:id="@+id/webView" | |
android:layout_width="match_parent" |