Closed AndroidDeveloperLB closed 6 years ago
might get wrong time-related operations if it's not updated by the user?
Yes.
Maybe update just the TZ database from a server (instead of the whole app) ?
You are free to do this, yes. It has nothing to do with this library though. You would use the no-tzdb threetenbp artifact and provide your own mechanism of updating and loading the zone data. This library just repackages the database into assets instead of as a Java resource.
Does Google somehow update the timezones on the device
No. But even if it did...
why not use it instead?
Because it's API 26+
If it's not, doesn't it mean that a lot of apps might get some time-related operations in the wrong way ?
Correct.
OK, this can be an issue.
Is there a way to avoid loading the TZ from the library, and do it only from the server that hosts the latest one? Maybe cache it, and load a new one only when there is a one?
Suppose the user use the app only for his own time zone, and we have a server that works only with UTC, will this assumption help in any way? Or there is no way to avoid this, and we would have to load timezones file?
About Google's API, there is also the older API, of Calendar. Thing is that you say they don't update the timezones, so even before, you mean it won't help, right?
How does the calendar app of Google (and others) handle the timezones, then? Do you think they load it from the server too?
I outlined how to do 1 above. The other questions aren't related to this library so I can't help there.
About loading the TZ file from server, you mean this: http://www.iana.org/time-zones ?
Will this library (and maybe even the one that it's based on) allow to load the file from there? And which file of there should I use?
About code, I think all I need to do is use this:
ZoneRulesInitializer.setInitializer(...);
And the implementation should be similar to this:
Right?
Or do I have to do something extra for the file that I get from this server?
It is said in "joda-time" website, that :
This means, for example, that an app that is based on any time-related library, including here, might get wrong time-related operations if it's not updated by the user?
Is there a way to overcome this? Maybe update just the TZ database from a server (instead of the whole app) ?
What happens to apps that don't use any library, and just use what the API provides? Are they "immune" to this issue ? Does Google somehow update the timezones on the device? If it does, why not use it instead? If it's not, doesn't it mean that a lot of apps might get some time-related operations in the wrong way ?