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

Side by Side Diff: README.md

Issue 29351744: Issue 4399 - Add WebView inheritor with ad blocking (Closed)
Patch Set: minor codestyle fixes Created Oct. 20, 2016, 1:16 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « .hgignore ('k') | build.gradle » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Adblock Plus Library for Android 1 Adblock Plus Library for Android
2 ======================== 2 ========================
3 3
4 An Android library project that runs a proxy to block ads. 4 An Android library project, tests and demo application for AdblockWebView widget .
5 5
6 Updating the dependencies 6 Updating the dependencies
7 ------------------------- 7 -------------------------
8 8
9 Adblock Plus Library for Android has dependencies that aren't in this repository . 9 Adblock Plus Library for Android has dependencies that aren't in this repository .
10 To update those, call: 10 To update those, call:
11 11
12 ./ensure_dependencies.py 12 ./ensure_dependencies.py
13 13
14 ## Library 14 ## Library
(...skipping 23 matching lines...) Expand all
38 ------------------- 38 -------------------
39 39
40 ### Requirements 40 ### Requirements
41 41
42 All 'Building with Ant' requirements and additional requirements: 42 All 'Building with Ant' requirements and additional requirements:
43 43
44 * [Maven](https://maven.apache.org) 44 * [Maven](https://maven.apache.org)
45 45
46 ### Building 46 ### Building
47 47
48 Go to android sdk directory '/platforms/android-21' and run:
49
50 mvn install:install-file -Dfile=./android.jar -DgroupId=com.google.android - DartifactId=android
51 -Dversion=5.0 -Dpackaging=jar -DgeneratePom=true
52
48 Set environment variable ANDROID_HOME to your Android SDK directory or pass it i n command-line (below). 53 Set environment variable ANDROID_HOME to your Android SDK directory or pass it i n command-line (below).
49 In the 'libadblockplus-android' directory run: 54 In the root directory run:
50 55
51 mvn clean install [-Dandroid.sdk.path=/some/where/sdk] 56 mvn clean install [-Dandroid.sdk.path=/some/where/sdk]
52 57
53 This will generate *.aar library artifact in the 'target' directory. 58 This will generate *.aar library artifacts in the 'libadblockplus-android/target ',
59 'libadblockplus-android-webview/target' directories and *.apk in
60 'libadblockplus-android-webviewapp/target' directory.
54 61
55 Building with Gradle/Android Studio 62 Building with Gradle/Android Studio
56 ----------------------------------- 63 -----------------------------------
57 64
58 ### Requirements 65 ### Requirements
59 66
60 * [The Android SDK](http://developer.android.com/sdk) 67 * [The Android SDK](http://developer.android.com/sdk)
61 * Android SDK Build tools 22.0.1 68 * Android SDK Build tools 22.0.1
62 * [The Android NDK](https://developer.android.com/tools/sdk/ndk) 69 * [The Android NDK](https://developer.android.com/tools/sdk/ndk)
63 70
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 Make sure you've created _local.properties_ file to build the library (see above ). 132 Make sure you've created _local.properties_ file to build the library (see above ).
126 In the project root directory run: 133 In the project root directory run:
127 134
128 ./gradlew assembleDebugAndroidTest 135 ./gradlew assembleDebugAndroidTest
129 136
130 This will generate *.apk in 'libadblockplus-android-tests/build/outputs/apk/' di rectory. 137 This will generate *.apk in 'libadblockplus-android-tests/build/outputs/apk/' di rectory.
131 138
132 ### Testing with Gradle/Android Studio 139 ### Testing with Gradle/Android Studio
133 140
134 You can select test class/method and click 'Run ..Test'. The library and test ap p will be 141 You can select test class/method and click 'Run ..Test'. The library and test ap p will be
135 compiled, installed to emuator/device and launched automatically. 142 compiled, installed to emulator/device and launched automatically.
143
144 ## WebView
145
146 You can find 'AdblockWebView' class in 'libadblockplus-android-webview' director y.
147
148 `AdblockWebView` class provides built-in ad blocking
149 (both resource loading filtering and element hiding) and inherits from Android
150 ['WebView'](https://developer.android.com/reference/android/webkit/WebView.html) .
151
152 ### Usage
153
154 In layout XML:
155
156 <org.adblockplus.android.AdblockWebView
157 android:id="@+id/main_webview"
158 android:layout_width="match_parent"
159 android:layout_height="match_parent"/>
160
161 In java source code:
162
163 AdblockWebView webView = (AdblockWebView) findViewById(R.id.main_webview);
164
165 Use `setDebugMode(boolean debugMode)` to turn debug log output (Android log and JS console) on/off.
166
167 Use `setAllowDrawDelay(int allowDrawDelay)` to set custom delay to start render webpage after 'DOMContentLoaded' event is fired.
168
169 Use `setFilterEngine(FilterEngine newFilterEngine)` to use external filter engin e
170 If filter engine is not set, it's created by AdblockWebView instance automatical ly.
171
172 Use `setAcceptableAdsEnabled(boolean enabled)` to enable/disable Acceptable Ads.
173
174 Use `dispose()` to release resources (**required**).
175
176 ### Building
177
178 Building with Ant
179 -----------------
180
181 In the 'libadblockplus-android-webview' directory create the file _local.propert ies_ and set
182 _sdk.dir_ to where you installed it, e.g.:
183
184 sdk.dir = /some/where/sdk
185
186 Then run:
187
188 ant debug
189
190
191 Building with Gradle
192 --------------------
193
194 In the project root directory run:
195
196 ./gradlew assemble
197
198 This will generate *.aar in 'libadblockplus-android-webview/build/outputs/aar' d irectory.
199
200 ## WebView Application
201
202 You can find demo application for 'AdblockWebView' class in
203 'libadblockplus-android-webviewapp' directory.
204
205 ### Building
206
207 Make sure _Library_ requirements are present.
208
209 Building with Ant
210 -----------------
211
212 In the 'libadblockplus-android-webviewapp' directory create the file _local.prop erties_ and set
213 _sdk.dir_ to where you installed it, e.g.:
214
215 sdk.dir = /some/where/sdk
216
217 Then run:
218
219 ant debug
220
221 This will generate *.apk in 'libadblockplus-android-webviewapp/bin/' directory.
222
223 Building with Gradle
224 --------------------
225
226 In the project root directory run:
227
228 ./gradlew assemble
229
230 This will generate *.apk in 'libadblockplus-android-webviewapp/build/outputs/apk /' directory.
OLDNEW
« no previous file with comments | « .hgignore ('k') | build.gradle » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld