Skip to content

Instantly share code, notes, and snippets.

View davedecoder's full-sized avatar
🎯
Focusing

David i.Rock davedecoder

🎯
Focusing
View GitHub Profile
// These two need to be declared outside the try/catch
// so that they can be closed in the finally block.
HttpURLConnection urlConnection = null;
BufferedReader reader = null;
// Will contain the raw JSON response as a string.
String forecastJsonStr = null;
try {
// Construct the URL for the OpenWeatherMap query