Android Library that checks if there is an Ad Blocker enabled and shows a customizable Material dialog.
Add the repository to your project build.gradle:
repositories {
maven {
url "https://jitpack.io"
}
}
And add the library to your module build.gradle:
dependencies {
compile 'com.github.javiersantos:AdBlockerAdvise:1.2'
}
AdBlockerAdviseDialog adBlockerAdvise = new AdBlockerAdviseDialog(this);
adBlockerAdvise.start();
Use the builder and add following.
adBlockerAdvise.setTitle("Don't use an Ad Blocker!");
adBlockerAdvise.setContent("The developer will be happier if you disable them.");
adBlockerAdvise.start();
By default, AdBlockerAdviseDialog will show a dialog every time it detects an enabled Ad Blocker, but it can be set to only appear once.
adBlockerAdvise.showOnlyOnce(true);
adBlockerAdvise.start();
boolean isAdBlocker = AdBlockerAdvise.isAdBlockerActivated();
Copyright 2015-2016 Javier Santos
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.