Android Library that checks if there is an Ad Blocker enabled and shows a customizable dialog. API 8+ required.
Java
Switch branches/tags
Clone or download
Latest commit 65ea7b7 Jul 9, 2016
Permalink
Failed to load latest commit information.
Screenshots Add library banner Feb 3, 2016
app Release library 1.2 May 15, 2016
gradle/wrapper Update libraries, gradle and remove androidTests May 15, 2016
library Release library 1.2 May 15, 2016
.gitignore
.travis.yml Create .travis.yml Feb 3, 2016
AdblockerAdvise.iml Update library to 1.0.1 Feb 2, 2016
LICENSE First working revision Jul 20, 2015
README.md Update README.md Jul 9, 2016
build.gradle Update libraries, gradle and remove androidTests May 15, 2016
gradle.properties First working revision Jul 20, 2015
gradlew First working revision Jul 20, 2015
gradlew.bat First working revision Jul 20, 2015
settings.gradle First working revision Jul 20, 2015

README.md

AdBlockerAdvise

Android Library

Android Library that checks if there is an Ad Blocker enabled and shows a customizable Material dialog.

How to include

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'
}

Usage

Activity

AdBlockerAdviseDialog adBlockerAdvise = new AdBlockerAdviseDialog(this);
adBlockerAdvise.start();

Customization

Use the builder and add following.

Custom title and content

adBlockerAdvise.setTitle("Don't use an Ad Blocker!");
adBlockerAdvise.setContent("The developer will be happier if you disable them.");
adBlockerAdvise.start();

Display dialog only once

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();

Other features

Retrieve if an Ad Blocker is enabled

boolean isAdBlocker = AdBlockerAdvise.isAdBlockerActivated();

AdBlockerAdvise

License

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.