JakeWharton / ThreeTenABP

An adaptation of the JSR-310 backport for Android.
Apache License 2.0
3.55k stars 133 forks source link

Use the Timezones present on the device #91

Closed PaulWoitaschek closed 5 years ago

PaulWoitaschek commented 5 years ago

Follow up of this Reddit Thread

Coudn't the zones that are provided here be taken from the java.util.time api as done in the desugar lib? From API 26 on we could query the zones directly from java.time

I ran a few time into an issue where devices crashed because the device timezone was not present in the tz db shipped with the library: https://github.com/JakeWharton/ThreeTenABP/issues/73

This would prevent such issues and also have the benefit reducing the library size. Inspecting my latest apk, the ArchiveEntry: pathPrefix="", path="/assets/org/threeten/bp/TZDB.dat" is 38.5 kb large.

JakeWharton commented 5 years ago

You don't really need this library for that. Just depend on the no-tzdb threetenbp artifact and copy/paste the zone provider from that file.

On Wed, Jan 2, 2019 at 4:24 PM Paul Woitaschek notifications@github.com wrote:

Follow up of this Reddit Thread https://www.reddit.com/r/androiddev/comments/abii86/okhttp_will_drop_support_for_android_4_in_their/ed2mgct

Coudn't the zones that are provided here https://github.com/JakeWharton/ThreeTenABP/blob/4e4abd0e81af3d11d457b9c0cc33c68b0904cfdc/threetenabp/src/main/java/com/jakewharton/threetenabp/AssetsZoneRulesInitializer.java#L23 be taken from the java.util.time api as done in the desugar lib? https://github.com/google/desugar_jdk_libs/blob/915f566d1dc23bc5a8975320cd2ff71be108eb9c/src/share/classes/java/time/zone/ZoneRulesProvider.java#L446 From API 26 on we could query the zones directly from java.time

I ran a few time into an issue where devices crashed because the device timezone was not present in the tz db shipped with the library: #73 https://github.com/JakeWharton/ThreeTenABP/issues/73

This would prevent such issues and also have the benefit reducing the library size. Inspecting my latest apk, the ArchiveEntry: pathPrefix="", path="/assets/org/threeten/bp/TZDB.dat" is 38.5 kb large.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JakeWharton/ThreeTenABP/issues/91, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEETBCOQo-in7EW_fILvIm3QgTfn83ks5u_SOqgaJpZM4ZnQHg .