Add option to build without Google dependencies #582
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
TL;DR : This is a fix for #486.
Change Log
I followed the instructions in this comment and used Gradle flavors so that it is easily configurable in Android Studio.
build.gradle
of:bVNC
, to build itwithGoogle
orwithoutGoogle
.bVNC/src/withGoogle/.../GoogleUtils.java
andbVNC/src/withoutGoogle/.../GoogleUtils.java
, to isolate Google dependencies imports.showRateAppDialog
, intoGoogleUtils.java
. When buildingwithGoogle
, it works as before, but forwithoutGoogle
it simply does nothing for now (should it log something? Let me know).bVNC/src/main/java/com/iiordanov/bVNC/Utils.java
. Removed the original declaration ofshowRateAppDialog
as well.showRateAppDialog
inConnectionGridActivity.java
to a reference to the newGoogleUtils
class.build.gradle
file of the modules that use:bVNC
, so that they know which flavor of:bVNC
to use (otherwise it cannot be resolved when building).README
to tell how to build without Google dependencies.I tried to avoid having two
GoogleUtils.java
files, but I had problems with the Google deps imports that caused errors when building without Google.Now, if you would prefer to keep everything in
Utils.java
, I might be able to figure something out with reflection if that sounds good enough to you, or search for something else, but right now the only solution I found to keep everything in one file is reflection.Please let me know if anything is unclear or if you would like anything changed in the PR.
Cheers !