-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Change the minimum supported Android API to 26. #2949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This is [Android 8.0](https://developer.android.com/tools/releases/platforms#8.0), released in August 2017. Only about 2% of devices have an older version.
|
This also means we can add |
Yes, that's a good point. Similar compatibility considerations to the Similarly This is probably not the serialization we would have chosen if there were no compatibility considerations. People can always register their own adapters (and probably often do already). I found several in Google's codebase, more than one of which serialized |
|
Can you please adjust the README as well: Lines 71 to 74 in a271f48
There are also (at least) these two places where the code could be improved now:
Or if you prefer I can do that in a separate PR. |
|
I ended up leaving a comment about this on a separate PR. Based on what you've subsequently said elsewhere, I think we may end up having to maintain three sorts of compatibility:
When it comes to Google-internal usage of the class, I think you'll end up wanting to maintain compatibility with minSdkVersion 23, but you could get away with requiring library desugaring. I wouldn't expect you to be able to get away with minSdkVersion 26 yet, though I hope we're only a year or two away.... Then the question would be whether all other users could meet a baseline of 23+desugaring or (if you can support it easily enough) an optional alternative baseline of 26 without need for desugaring. (It's possible to have fancy Animal Sniffer checking to check both of those.) You might prefer to keep things simple and compatible for now. That could mean supporting minSdkVersion 23 even without desugaring (as Guava does unless you use APIs with "Java 8" types in them), in which case the main work to do is to suppress the errors you're seeing, since the "Java 8" code in #2948 already won't run except under a newer Android version. But as always, nothing will be as simple as it should be. |
|
The functional interfaces can have Java 8 annotation |
This is Android
8.0, released in August 2017. Only about 2% of devices have an older version.
Requiring API Level 26 means we can use
java.timeAPIs without reflection.