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

Side by Side Diff: README.md

Issue 29691555: Issue 6364 - Exclude double initialization of AdblockHelper (Closed)
Patch Set: Created Feb. 7, 2018, 9:28 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 Adblock Plus Library for Android 1 Adblock Plus Library for Android
2 ================================ 2 ================================
3 3
4 An Android library project, tests and demo application for AdblockWebView widget . 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 Adblock Plus for Android has dependencies that aren't in this repository. 8 Adblock Plus for Android has dependencies that aren't in this repository.
9 To update those, call: 9 To update those, call:
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 You can use `SharedPrefsStorage` implementation to store settings in `SharedPref erences`. 142 You can use `SharedPrefsStorage` implementation to store settings in `SharedPref erences`.
143 Or you can use AdblockHelper: 143 Or you can use AdblockHelper:
144 144
145 AdblockHelper 145 AdblockHelper
146 .get() 146 .get()
147 .init(this, getFilesDir().getAbsolutePath(), true, AdblockHelper.PREFERENC E_NAME); 147 .init(this, getFilesDir().getAbsolutePath(), true, AdblockHelper.PREFERENC E_NAME);
148 148
149 // optional - provide preloaded subscription files in app resoruces 149 // optional - provide preloaded subscription files in app resoruces
150 .preloadSubscriptions(AdblockHelper.PRELOAD_PREFERENCE_NAME, map); 150 .preloadSubscriptions(AdblockHelper.PRELOAD_PREFERENCE_NAME, map);
151 151
152 Make sure you initialize it once during app launch, call `isInit()` to check it:
153
154 if (!AdblockHelper.get().isInit())
155 {
156 // requires initialization
157 ...
158 }
159
152 Sometimes it's desired to initialize or deinitialize FilterEngine instance 160 Sometimes it's desired to initialize or deinitialize FilterEngine instance
153 when created: 161 when created:
154 162
155 AdblockHelper 163 AdblockHelper
156 .get() 164 .get()
157 .init(...) 165 .init(...)
158 .addEngineCreatedListener(engineCreatedListener) 166 .addEngineCreatedListener(engineCreatedListener)
159 167
160 or disposed: 168 or disposed:
161 169
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 262
255 ### Building 263 ### Building
256 264
257 Make sure _Library_ requirements are present. 265 Make sure _Library_ requirements are present.
258 266
259 In the project root directory run: 267 In the project root directory run:
260 268
261 ./gradlew assemble 269 ./gradlew assemble
262 270
263 This will generate *.apk in the 'libadblockplus-android-webviewapp/build/outputs /apk/' directory. 271 This will generate *.apk in the 'libadblockplus-android-webviewapp/build/outputs /apk/' directory.
OLDNEW

Powered by Google App Engine
This is Rietveld