Replies: 26 comments
-
+1000 to enable incremental compilation As for: |
Beta Was this translation helpful? Give feedback.
-
Regarding "migrate rxjava (1.3.3) to rxjava2", I've already done that in my fork if you want to check out that code. I've also changed the targetSdk to version 26. I'm testing on a Pixel 2 running Android 11 and everything seems to be working fine so far. |
Beta Was this translation helpful? Give feedback.
-
Thx for the offer, but we need clean commits/PRs which addresses certain problems "atomically". I took a look at your fork and found that commit 1a6d6a3 mixes rxJava and Bt related stuff. If would be great I you can provide a clean PR. |
Beta Was this translation helpful? Give feedback.
-
It already works for me if I go straight to Android Gradle Plugin 4.1.1 and use the jetifier (
Yea, that's a problem that it is not documented. Anyway, API level 26+ is only required if we like to provide an app in the Google Play Store. |
Beta Was this translation helpful? Give feedback.
-
No problem I understand. However only the following files are needed for rxjava2 migration: Those files have no bluetooth code modified, only rxjava. |
Beta Was this translation helpful? Give feedback.
-
@nickb24 Okay, thanks. I just scammed the commits. Will continue tomorrow. |
Beta Was this translation helpful? Give feedback.
-
Improving the code allowing xDrip+ to be provided by the official PlayStore would be a great benefit to all ppl with company phones. These are blocking sideloading of unknown apps ("blocked by our IT admin") -> only PlayStore apps are allowed for "security reasons". With the latest Android security updates (Samsung company phone) all workarounds to enable sideloading xDrip+ are now being blocked as well, so it's a rather urgent issue. |
Beta Was this translation helpful? Give feedback.
-
@tolot27 Migrating to AndroidX (probably done by an experienced xDrip dev) also gives the opportunity for new features. I implemented Android Auto compatibility where your car can read your alarms loud for you but the car connectivity required migrating to AndroidX. I've done it in my branch but as many many files have automatically been changed while migrating and I'm quite new to xDrip developing, I have no idea if all of the other features are still working after Android Studios auto-migration. As soon as the migration to AndroidX is done, I can implement the Android Auto connectivity with ease. |
Beta Was this translation helpful? Give feedback.
-
@tim162 Please can you create a new branch in your repro based on master and just set |
Beta Was this translation helpful? Give feedback.
-
@tolot27 you can check #1533 (comment) |
Beta Was this translation helpful? Give feedback.
-
This is a perfectly reasonable set of tasks but there are also reasons why many of these things have not been done before. The most significant is that it is very hard to test the subtle interaction changes that can occur with library and other changes. I'll just comment on the things I think are significant or disagree with: I don't believe the assumption that newer versions of google libraries are always better is correct. I've been bitten by minor changes to even the build tool revision numbers causing behavior changes before so it needs to be handled with lots of care. Older libraries get tested on newer devices but rarely does that happen in reverse. For example some LG Android 5 phones don't support vector drawables which is why xDrip works around that. Remote repositories can stop hosting the libraries we might be using which might cause problems in the future. I don't agree with moving locally hosted ones to reference the remote repository without a good reason. Google famously removed one of the wear libraries we were using. I very much doubt that xDrip will get listed on the play store. Just one example we would have to remove SMS functionality. Their policies are very developer unfriendly and unfriendly to apps which want to do things like always maintaining bluetooth connections etc. Targeting newer SDK versions is probably worth avoiding unless we have to. I think we'd lose access to some of the mechanisms we're using to keep the app always running smoothly and also the hidden api calls that we use to work around bugs in the framework. Question regarding incremental compilation, does this still work while maintaining the minsdkversion at 18? don't you exceed the 65k public method limit and therefore need to use the proguard shrinking which is incompatible with it? |
Beta Was this translation helpful? Give feedback.
-
Some new security-related tasks arose during the code review:
I had to add it to the initial comment to get the tasks recognized. |
Beta Was this translation helpful? Give feedback.
-
I agree with you that we need comprehensive tests. Most of the bugs reported here are related to the devices xDrip supports (mostly related to Bluetooth). If we would use the different build channels better, we could get better feedback from the users willing to test newer builds. Up to now, most of the users have to install the nightly build. That is the biggest risk I can see so far.
I totally agree with you that newer libraries are not always better. But often, they are better and much safer. The AndroidX libraries for instance are increasing the compatibility - not in every case, that is not possible, but for most of the apps.
How many users are still using LG Android 5 phones?
Indeed that happened and can happen in the future. But when it happens, we can integrate the latest available/most suitable library into xDrip at that time. Currently, I do not see any reason why we should keep unused libraries in the xDrip repository and integrating them into the apk.
We can target new SDK versions to test it with newer builds (on the nightly channel) while not increasing
I wonder why we should still support Android 4.3 (= API version 18). I cannot believe that there is a significant number of users using such old Android devices and requiring the most recent version of xDrip. Anyway, we can create additional build types for lower API versions any time. Before we do that, we could ask the users analyse log statistics. The incremental compilation depends just on the Gradle version and Android Gradle Plugin (AGP) version used and not on My hope is that it is getting more and more attractive for developers to contribute to xDrip. Once that's the case, we can improve testing and integrate new features faster. |
Beta Was this translation helpful? Give feedback.
-
I did a rework of the incremental compilation and pushed a new PR #1598. |
Beta Was this translation helpful? Give feedback.
-
One more advantage of upgrading AGP to 4.x is the availability of the Build Analyzer. But once again, this needs the fix of the package names. |
Beta Was this translation helpful? Give feedback.
-
Hi all. If someone will briefly explain me how to build, I'm available to write some documentation about it. Thanks a lot |
Beta Was this translation helpful? Give feedback.
-
I don't think there are any special build instructions. I installed latest Android Studio in Ubuntu. Open Android studio and follow the prompts to import a project from Github. The project should build just fine. If you can post where you are stuck in this process maybe I can take a look and see if I can help. |
Beta Was this translation helpful? Give feedback.
-
Indeed, you can build from command line using gradle. @afcady provided a makefile with #903.
That would be great. Maybe you can extend https://xdrip.github.io? |
Beta Was this translation helpful? Give feedback.
-
This is a very straightforward work. Is there any work going on on this project? |
Beta Was this translation helpful? Give feedback.
-
@nickb24 Why did you add the |
Beta Was this translation helpful? Give feedback.
-
That's a good question. I'm honestly unsure at this point, it's been over 1 year that I touched that code. Looking at it now I think you are right, it can be removed. I believe at the time I was following a guide from Github on how to migrate to RxJava2 and it might have come from there. I believe I was trying to catch null values, since RxJava2 doesn't accept null values Docs. |
Beta Was this translation helpful? Give feedback.
-
Regarding code formatting @jwoglom suggested the Github Action Checkstyle for Java and @suside suggested spotless. According to @suside spotless has the following advantages over actions/checkstyle-for-java:
It could be something like this GitHub Actions can be tested on developer machines as well using act. A feature what I really like to have is partial code formatting. For the moment, just the code a commit provides/touches should be reformatted to not distract the review process too much. Is this possible with one of these tools? |
Beta Was this translation helpful? Give feedback.
-
It looks like checkstyle-for-java supports partial reformatting using filter-mode. Since it uses reviewdog, many other languages are supported as well. Here, Kotlin, JSON and XML are of interest. Spotless seem to support gradual formatting but the setup looks trickier. |
Beta Was this translation helpful? Give feedback.
-
I did some testing and checkstyle+reviewdog wins when it comes to checking only changed lines. IMO linter should fail during build while suggestions should be in the log output and not as review comments. Such scenario is possible with CLI run like so |
Beta Was this translation helpful? Give feedback.
-
Thanks for testing this. It looks like sometimes an incorrect line is reported (i. e. suside#5 (comment)). |
Beta Was this translation helpful? Give feedback.
-
I don't think it's possible without external tools to format checkstyle output before it is fed to reviewdog. |
Beta Was this translation helpful? Give feedback.
-
Over the last couple of days I spent some time to understand the xDrip code. After some reviewing I found the following issues which I like to address soon:
com.android.support:support-annotations
which is currently in use (74a4f02)android.enableSeparateAnnotationProcessing=true
)android.databinding.enableV2=true
) is removed) (fix package names and add support for incremental compilation #1539)android.useAndroidX=true
andandroid.enableJetifier=true
ingradle.properties
(74a4f02)migrate from Fabric Crashlytics (io.fabric) to Firebase Crashlyticsit was replaced by New RelicConstants
andDex_Constants
) and improve maintenance (see Initiative: Better Support for Android Wear #1733). Good example is provided at https://stackoverflow.com/a/62966117/10373188.Some new security-related tasks arose during the code review:
google-services.json
either by using Travis Encrypting Files or creating a new build type containing a dummygoogle-services.json
file.Beta Was this translation helpful? Give feedback.
All reactions