public class OWM
Starting point for this lib. If you're new to this API, start from this class.
Lets you access data from OpenWeatherMap.org using its Weather APIs.
Sample code in Java:
OWM owm = new OWM("your-api-key");
Sample code in Kotlin:
val owm: OWM = OWM("your-api-key")
Constructor and Description |
---|
OWM(String apiKey)
Constructor
|
Modifier and Type | Method and Description |
---|---|
AirPollution |
airPollutionByCoords(double latitude,
double longitude,
String dateTime) |
AirPollution |
airPollutionByCoords(double latitude,
double longitude,
NonExistentClass dateTime) |
AirPollution |
currentAirPollutionByCoords(double latitude,
double longitude) |
CurrentUVIndex |
currentUVIndexByCoords(double latitude,
double longitude) |
CurrentWeather |
currentWeatherByCityId(int cityId) |
CurrentWeather |
currentWeatherByCityName(String cityName) |
CurrentWeather |
currentWeatherByCityName(String cityName,
OWM.Country countryCode) |
CurrentWeather |
currentWeatherByCoords(double latitude,
double longitude) |
CurrentWeather |
currentWeatherByZipCode(int zipCode) |
CurrentWeather |
currentWeatherByZipCode(int zipCode,
OWM.Country countryCode) |
List<net.aksingh.owmjapis.model.DailyUVIndexForecast> |
dailyUVIndexForecastByCoords(double latitude,
double longitude) |
DailyWeatherForecast |
dailyWeatherForecastByCityId(int cityId) |
DailyWeatherForecast |
dailyWeatherForecastByCityId(int cityId,
int count) |
DailyWeatherForecast |
dailyWeatherForecastByCityName(String cityName) |
DailyWeatherForecast |
dailyWeatherForecastByCityName(String cityName,
int count) |
DailyWeatherForecast |
dailyWeatherForecastByCityName(String cityName,
OWM.Country countryCode) |
DailyWeatherForecast |
dailyWeatherForecastByCityName(String cityName,
OWM.Country countryCode,
int count) |
DailyWeatherForecast |
dailyWeatherForecastByCoords(double latitude,
double longitude) |
DailyWeatherForecast |
dailyWeatherForecastByCoords(double latitude,
double longitude,
int count) |
DailyWeatherForecast |
dailyWeatherForecastByZipCode(int zipCode) |
DailyWeatherForecast |
dailyWeatherForecastByZipCode(int zipCode,
int count) |
DailyWeatherForecast |
dailyWeatherForecastByZipCode(int zipCode,
OWM.Country countryCode) |
DailyWeatherForecast |
dailyWeatherForecastByZipCode(int zipCode,
OWM.Country countryCode,
int count) |
List<net.aksingh.owmjapis.model.HistoricalUVIndex> |
historicalUVIndexByCoords(double latitude,
double longitude,
int count,
long startTime,
long endTime) |
List<net.aksingh.owmjapis.model.HistoricalUVIndex> |
historicalUVIndexByCoords(double latitude,
double longitude,
int count,
NonExistentClass startTime,
NonExistentClass endTime) |
List<net.aksingh.owmjapis.model.HistoricalUVIndex> |
historicalUVIndexByCoords(double latitude,
double longitude,
long startTime,
long endTime) |
List<net.aksingh.owmjapis.model.HistoricalUVIndex> |
historicalUVIndexByCoords(double latitude,
double longitude,
NonExistentClass startTime,
NonExistentClass endTime) |
HourlyWeatherForecast |
hourlyWeatherForecastByCityId(int cityId) |
HourlyWeatherForecast |
hourlyWeatherForecastByCityName(String cityName) |
HourlyWeatherForecast |
hourlyWeatherForecastByCityName(String cityName,
OWM.Country countryCode) |
HourlyWeatherForecast |
hourlyWeatherForecastByCoords(double latitude,
double longitude) |
HourlyWeatherForecast |
hourlyWeatherForecastByZipCode(int zipCode) |
HourlyWeatherForecast |
hourlyWeatherForecastByZipCode(int zipCode,
OWM.Country countryCode) |
void |
resetProxy()
Reset proxy to system's proxy for getting data from OpenWeatherMap.org
|
OWM |
setAccuracy(OWM.Accuracy accuracy)
Set search accuracy for getting data from OpenWeatherMap.org
|
OWM |
setLanguage(OWM.Language lang)
Set language for getting data from OpenWeatherMap.org
|
OWM |
setNoProxy()
Remove proxy (i.e., direct connection) for getting data from OpenWeatherMap.org
|
OWM |
setProxy(NonExistentClass proxy)
Set proxy for getting data from OpenWeatherMap.org
|
OWM |
setProxy(NonExistentClass proxy,
String user,
String pass)
Set authenticated proxy for getting data from OpenWeatherMap.org
|
OWM |
setProxy(String host,
int port)
Set HTTP proxy for getting data from OpenWeatherMap.org
|
OWM |
setProxy(String host,
int port,
NonExistentClass type)
Set proxy of any type for getting data from OpenWeatherMap.org
|
OWM |
setProxy(String host,
int port,
String user,
String pass)
Set authenticated HTTP proxy for getting data from OpenWeatherMap.org
|
OWM |
setProxy(String host,
int port,
String user,
String pass,
NonExistentClass type)
Set authenticated proxy of any type for getting data from OpenWeatherMap.org
|
OWM |
setUnit(OWM.Unit unit)
Set unit for getting data from OpenWeatherMap.org
|
public OWM(String apiKey)
Constructor
Defaults: Search accuracy is set to like Defaults: Unit is set to standard Defaults: Language is set to English Defaults: Proxy is set to system's proxy
apiKey
- API key from OpenWeatherMap.orgpublic OWM setAccuracy(OWM.Accuracy accuracy)
Set search accuracy for getting data from OpenWeatherMap.org
accuracy
- Search accuracypublic OWM setUnit(OWM.Unit unit)
Set unit for getting data from OpenWeatherMap.org
unit
- Unitpublic OWM setLanguage(OWM.Language lang)
Set language for getting data from OpenWeatherMap.org
lang
- Languagepublic OWM setProxy(NonExistentClass proxy)
Set proxy for getting data from OpenWeatherMap.org
proxy
- Proxypublic OWM setProxy(NonExistentClass proxy, String user, String pass)
Set authenticated proxy for getting data from OpenWeatherMap.org
proxy
- Proxyuser
- User name for the proxypass
- Password for the proxypublic OWM setProxy(String host, int port)
Set HTTP proxy for getting data from OpenWeatherMap.org
host
- Host address of the proxyport
- Port address of the proxypublic OWM setProxy(String host, int port, NonExistentClass type)
Set proxy of any type for getting data from OpenWeatherMap.org
host
- Host address of the proxyport
- Port address of the proxytype
- Type of the proxypublic OWM setProxy(String host, int port, String user, String pass)
Set authenticated HTTP proxy for getting data from OpenWeatherMap.org
host
- Host address of the proxyport
- Port address of the proxyuser
- User name for the proxy if requiredpass
- Password for the proxy if requiredpublic OWM setProxy(String host, int port, String user, String pass, NonExistentClass type)
Set authenticated proxy of any type for getting data from OpenWeatherMap.org
host
- Host address of the proxyport
- Port address of the proxyuser
- User name for the proxy if requiredpass
- Password for the proxy if requiredtype
- Type of the proxypublic OWM setNoProxy()
Remove proxy (i.e., direct connection) for getting data from OpenWeatherMap.org
public void resetProxy()
Reset proxy to system's proxy for getting data from OpenWeatherMap.org
public CurrentWeather currentWeatherByCityName(String cityName)
public CurrentWeather currentWeatherByCityName(String cityName, OWM.Country countryCode)
public CurrentWeather currentWeatherByCityId(int cityId)
public CurrentWeather currentWeatherByCoords(double latitude, double longitude)
public CurrentWeather currentWeatherByZipCode(int zipCode)
public CurrentWeather currentWeatherByZipCode(int zipCode, OWM.Country countryCode)
public HourlyWeatherForecast hourlyWeatherForecastByCityName(String cityName)
public HourlyWeatherForecast hourlyWeatherForecastByCityName(String cityName, OWM.Country countryCode)
public HourlyWeatherForecast hourlyWeatherForecastByCityId(int cityId)
public HourlyWeatherForecast hourlyWeatherForecastByCoords(double latitude, double longitude)
public HourlyWeatherForecast hourlyWeatherForecastByZipCode(int zipCode)
public HourlyWeatherForecast hourlyWeatherForecastByZipCode(int zipCode, OWM.Country countryCode)
public DailyWeatherForecast dailyWeatherForecastByCityName(String cityName)
public DailyWeatherForecast dailyWeatherForecastByCityName(String cityName, int count)
public DailyWeatherForecast dailyWeatherForecastByCityName(String cityName, OWM.Country countryCode)
public DailyWeatherForecast dailyWeatherForecastByCityName(String cityName, OWM.Country countryCode, int count)
public DailyWeatherForecast dailyWeatherForecastByCityId(int cityId)
public DailyWeatherForecast dailyWeatherForecastByCityId(int cityId, int count)
public DailyWeatherForecast dailyWeatherForecastByCoords(double latitude, double longitude)
public DailyWeatherForecast dailyWeatherForecastByCoords(double latitude, double longitude, int count)
public DailyWeatherForecast dailyWeatherForecastByZipCode(int zipCode)
public DailyWeatherForecast dailyWeatherForecastByZipCode(int zipCode, int count)
public DailyWeatherForecast dailyWeatherForecastByZipCode(int zipCode, OWM.Country countryCode)
public DailyWeatherForecast dailyWeatherForecastByZipCode(int zipCode, OWM.Country countryCode, int count)
public CurrentUVIndex currentUVIndexByCoords(double latitude, double longitude)
public List<net.aksingh.owmjapis.model.DailyUVIndexForecast> dailyUVIndexForecastByCoords(double latitude, double longitude)
public List<net.aksingh.owmjapis.model.HistoricalUVIndex> historicalUVIndexByCoords(double latitude, double longitude, int count, long startTime, long endTime)
public List<net.aksingh.owmjapis.model.HistoricalUVIndex> historicalUVIndexByCoords(double latitude, double longitude, int count, NonExistentClass startTime, NonExistentClass endTime)
public List<net.aksingh.owmjapis.model.HistoricalUVIndex> historicalUVIndexByCoords(double latitude, double longitude, long startTime, long endTime)
public List<net.aksingh.owmjapis.model.HistoricalUVIndex> historicalUVIndexByCoords(double latitude, double longitude, NonExistentClass startTime, NonExistentClass endTime)
public AirPollution airPollutionByCoords(double latitude, double longitude, String dateTime)
public AirPollution airPollutionByCoords(double latitude, double longitude, NonExistentClass dateTime)
public AirPollution currentAirPollutionByCoords(double latitude, double longitude)