An ordinary webview that can block basic ads.
Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.islamdidarmd:AdBlockerWebview:0.1.0'
}
Add AdBlockerWebview In your layout
<com.islamdidarmd.adblockerwebview.AdBlockerWebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
In your Activity or Fragment
webview.setAdBlockEnabled(true)
webview.loadUrl("https://google.com")
You can also extend AdBlockerWebView
to add additional functionality
For a complete example, see the sample app