Open DadiBit opened 2 years ago
What to input as location? Longitude-latitude or city name?
What to input as location? Longitude-latitude or city name?
Currently the client constructor accepts:
coordinates: Pair<Float, Float>
)Okay, i'll try it. Thanks for the suggestion.
I did some testing and I realized the library is just overkill for the launcher (1+ MB = too heavy): I'll work on a fork without implementing the library, but instead implementing the useful parts (protobuf isn't needed, as only one city name is retrieved).
You can open a pull request for a successful implementation, thanks.
if the app can some how get the Longitude-latitude via location and still be able to be on fdroid aka no play services that would be good then the weather could also auto update location
@The-Repo-Club I think, inputting location data manually is more privacy friendly.
ya having the option if wanting to would be nice though doesn't need to be on by default :)
Checklist
Feature description
Hello, I would like to help implement the Open-Meteo API in the launcher, as it requires no API key (hence it's more user-friendly). I'm currently the only contributor to the open-meteo-api-kotlin library, and I haven't finished it, but I feel like to could benefit this project. Some "pseudo-code":
Endpoint
withGeocodingSearch.context
Endpoint
withForecast.context
Forecast.Query(latitude, longitude, currentWeather = true, /* units */)
response.currentWeather?.temperature
for the temperatureresponse.currentWeather?.weatherCode?.message
for the printable messageresponse.currentWeather?.weatherCode?.code
for the wmo int code (see at the end of the docs)If you need the weather forecast, I would recommend to instead:
openMeteo(...)
ForecastHourly.Temperature2m
ForecastHourly.Weathercode
(convertible withWeatherCode.from(it)
)message
)Short
code to map icons (code
)ForecastDaily.Sunrise
andForecastDaily.Sunset
(convertible withTime(it)
)TimeZone
usage)*Note: if GPS auto-location were to be implemented, it would be easy to update the coordinates (next version will have
var
coordinates)Additional information
A nice feature of the API is that it provides hourly/daily values up to a week, easing data caching. I'd like also to receive some inputs on how I could make the library more accessible to other developers (I know that the documentation and tests are completely missing in version 0.2.0-alpha, please have mercy), in order to ease the transaction to it.