xsavikx / openweathermap-java-api Goto Github PK
View Code? Open in Web Editor NEWJava API to access openweathermap.org API
License: Apache License 2.0
Java API to access openweathermap.org API
License: Apache License 2.0
Openweather API states that they return date-time of calculation in UTC timezone
https://openweathermap.org/api/hourly-forecast#JSON
list.dt_txt Data/time of calculation, UTC
However, when deserialization takes place, ISOStringDateTypeAdapter is using rough 'new SimpleDateFormat(ISO_DATE_FORMAT)' without timezone which results in system default timezone.
Also, I don't think that using SimpleDateFormat is a good solution for parallel operation. I suggest using FastDateFormat of ThreadLocal for SDF if you don't want additional dependencies for you lib.
Hi, is there a maven dependency I can add to my maven Java project to get this code? If not, is there a different way that I can use the existing donwloaded zip file in my maven project?
Thank you.
Hi !
the following error appeared on my project some days ago:
Could not resolve dependencies for project com.xxx.yyy:jar:0.1-SNAPSHOT: Failed to collect dependencies at org.openweathermap.java-api:api-core:jar:1.2.3: Failed to read artifact descriptor for org.openweathermap.java-api:api-core:jar:1.2.3: Could not transfer artifact org.openweathermap.java-api:api-core:pom:1.2.3 from/to bintray-xsavikx-openweathermap-java-api (https://dl.bintray.com/xsavikx/openweathermap-java-api)
to confirm, when I try to manually download the jar https://jcenter.bintray.com/org/openweathermap/java-api/api-core/1.2.3/api-core-1.2.3.jar at https://mvnrepository.com/artifact/org.openweathermap.java-api/api-core/1.2.3 it fails with error 403.
could you fix this issue please ?
best regards,
kendy
Model org.openweathermap.api.model.forecast.City is missing a crucial field 'timezone' returned from api openweathermap.
Since api returns date and time in UTC timezone, you'll have to make some workaround in order to get localdatetime from coordinates (and use external api or external dependencies)...
i'm trying to get the jars to get in my project and when i'm running the graddle script for building i'm getting:
11:37:02 AM: Executing task...
Could not determine java version from '11.0.2'.
11:37:04 AM: Task execution finished.
Here is the announcement:
https://openweather.co.uk/blog/post/we-have-integrated-time-zones-our-weather-api-products
And diff:
diff --git a/api-model/src/main/java/org/openweathermap/api/model/currentweather/CurrentWeather.java b/api-model/src/main/java/org/openweathermap/api/model/currentweather/CurrentWeather.java
index 4468b40..a893495 100644
--- a/api-model/src/main/java/org/openweathermap/api/model/currentweather/CurrentWeather.java
+++ b/api-model/src/main/java/org/openweathermap/api/model/currentweather/CurrentWeather.java
@@ -28,4 +28,5 @@ public class CurrentWeather extends AbstractWeatherInformation {
private String visibility;
@SerializedName("sys")
private SystemParameters systemParameters;
+ private long timezone; // Shift in seconds from UTC
}
It's always failing in :app:transformClassesAndResourcesWithProguardForStagingRelease
Adding -keep class lombok.** { *; } in the proguard file did not help.
11:15:06.286 [ERROR] [system.err] Warning: there were 728 unresolved references to classes or interfaces.
11:15:06.286 [ERROR] [system.err] You may need to add missing library jars or update their versions.
11:15:06.286 [ERROR] [system.err] If your code works fine without the missing classes, you can suppress
11:15:06.286 [ERROR] [system.err] the warnings with '-dontwarn' options.
11:15:06.286 [ERROR] [system.err] (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
11:15:06.286 [ERROR] [system.err] Warning: there were 2 unresolved references to program class members.
11:15:06.286 [ERROR] [system.err] Your input classes appear to be inconsistent.
11:15:06.286 [ERROR] [system.err] You may need to recompile the code.
11:15:06.286 [ERROR] [system.err] (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
in the attached file you can find all the warnings about the classes and interfaces that cannot be found.
lombok_warnings.txt
Am I importing your library incorrectly?
In my build.gradle file I imported the api like this:
dependencies {
...
api 'org.openweathermap.java-api:api-core:1.0'
}
Edit: by using -dontwarn lombok.** I can build the apk, but then at runtime when querying daily forecasts, the DailyForecast.getWeather() method returns null. This does not happen with the debug build or by not using proguard in the release build.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.