Ok, ragazzi! Grazie mille e ci siamo quasi! Vi chiedo cortesemente un altro piccolo aiuto se possibile.
Io ho scelto la 2° opzione (wrapper) -> ho scaricato la yahoo-weather-java-api. Questa libreria mi chiede una particolare dipendenza: SLF4J (ho scaricato l'ultima distribuzione slf4j-1.7.7.zip).
Ho aperto un nuovo progetto in Eclipse e prelevato la classe di esempio che trovate qui sotto:
Codice PHP:
/**
*
*/
package com.github.fedy2.weather.test;
import java.io.IOException;
import javax.xml.bind.JAXBException;
import com.github.fedy2.weather.YahooWeatherService;
import com.github.fedy2.weather.data.Channel;
import com.github.fedy2.weather.data.unit.DegreeUnit;
/**
* @author "Federico De Faveri defaveri@gmail.com"
*
*/
public class Example {
/**
* @param args
* @throws JAXBException
* @throws IOException
*/
public static void main(String[] args) throws JAXBException, IOException {
YahooWeatherService service = new YahooWeatherService();
Channel channel = service.getForecast("670807", DegreeUnit.CELSIUS);
System.out.println(channel.getDescription());
}
}
e poi ho copiato la classe "YahooWeatherService.java" nel mio progetto (copia e incolla scompattando l'archivio yahoo-weahter-api.zip").
Però c'è un problema: chiede la SLF4J -> ho scompattato l'archivio e mi ritrovo con un sacco di file Jar... Intuisco che dovrei fare un "Add External Jar File" ma ho provato a mettere tutti i file Jar trovarti ma mi restituisce ancora qualche errore... Mamma mia che sfortuna!
Voi che siete molto più esperti di me, che posso fare?