Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: README.md

Issue 29351744: Issue 4399 - Add WebView inheritor with ad blocking (Closed)
Patch Set: added goBack/goForward support, added 'setAAenabled' setting, modified app for testing Created Sept. 26, 2016, 12:59 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « .gitignore ('k') | libadblockplus-android-tests/build.gradle » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: README.md
diff --git a/README.md b/README.md
index ce2d29c550de70be4b3c4cb51557e0fd95199477..ecf9f6351499273e7bb115eace2d0d9dc11ba1d9 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
Adblock Plus Library for Android
========================
-An Android library project that runs a proxy to block ads.
+An Android library project, tests and demo application for AdblockWebView widget.
Updating the dependencies
-------------------------
@@ -45,6 +45,10 @@ All 'Building with Ant' requirements and additional requirements:
### Building
+Go to android sdk directory '/platforms/android-19' and run:
+
+ mvn install:install-file -Dfile=./android.jar -DgroupId=com.google.android -DartifactId=android -Dversion=4.4 -Dpackaging=jar -DgeneratePom=true
+
Set environment variable ANDROID_HOME to your Android SDK directory or pass it in command-line (below).
In the 'libadblockplus-android' directory run:
@@ -132,4 +136,64 @@ This will generate *.apk in 'libadblockplus-android-tests/build/outputs/apk/' di
### Testing with Gradle/Android Studio
You can select test class/method and click 'Run ..Test'. The library and test app will be
-compiled, installed to emuator/device and launched automatically.
+compiled, installed to emulator/device and launched automatically.
+
+## WebView Application
+
+You can find demo application for 'AdblockWebView' widget in
+'libadblockplus-android-webviewapp' directory.
+
+### AdblockWebView usage
+
+`AdblockWebView` class provides built-in ad blocking
+(both resource loading filtering and element hiding), inherits from Android
+['WebView'](https://developer.android.com/reference/android/webkit/WebView.html) and is drop-in replacement:
+
+In layout XML:
+
+ <org.adblockplus.android.AdblockWebView
+ android:id="@+id/main_webview"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
+
+In java source code:
+
+ AdblockWebView webView = (AdblockWebView) findViewById(R.id.main_webview);
+
+Use `setDebugMode(boolean debugMode)` to turn debug log output (Android log and JS console) on/off.
+
+Use `setAllowDrawDelay(int allowDrawDelay)` to set custom delay to start render webpage after 'DOMContentLoaded' event is fired.
+
+Use `setFilterEngine(FilterEngine newFilterEngine)` to use external filter engine
+If filter engine is not set, it's created by AdblockWebView instance automatically.
+
+Use `setAcceptableAdsEnabled(boolean enabled)` to enable/disable Acceptable Ads.
+
+Use `dispose()` to release resources (required).
+
+### Building
+
+Make sure _Library_ requirements are present.
+
+Building with Ant
+-----------------
+
+In the 'libadblockplus-android-webviewapp' directory create the file _local.properties_ and set
+_sdk.dir_ to where you installed it, e.g.:
+
+ sdk.dir = /some/where/sdk
+
+Then run:
+
+ ant debug
+
+This will generate *.apk in 'libadblockplus-android-webviewapp/bin/' directory.
+
+Building with Gradle
+--------------------
+
+In the project root directory run:
+
+ ./gradlew assemble
+
+This will generate *.apk in 'libadblockplus-android-webviewapp/build/outputs/apk/' directory.
« no previous file with comments | « .gitignore ('k') | libadblockplus-android-tests/build.gradle » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld