Tag: wunderground

带有GSON的Java JSON

这是问题所在,我正在使用Wunderground的天气APi,并且无法使用GSON来获取天气。 import java.net.*; import java.io.*; import com.google.gson.*; public class URLReader { public static URL link; public static void main(String[] args) { try{ open(); read(); }catch(IOException e){} } public static void open(){ try{ link = new URL(“http://api.wunderground.com/api/54f05b23fd8fd4b0/geolookup/conditions/forecast/q/US/CO/Denver.json”); }catch(MalformedURLException e){} } public static void read() throws IOException{ Gson gson = new Gson(); // Code to get variables […]