This repository was archived by the owner on Jun 23, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
src/main/java/com/example/android/sunshine/app Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ android {
1717 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
1818 }
1919 }
20+ buildTypes. each {
21+ it. buildConfigField ' String' , ' OPEN_WEATHER_MAP_API_KEY' , MyOpenWeatherMapApiKey
22+ }
2023}
2124
2225dependencies {
Original file line number Diff line number Diff line change @@ -369,12 +369,14 @@ protected String[] doInBackground(String... params) {
369369 final String FORMAT_PARAM = "mode" ;
370370 final String UNITS_PARAM = "units" ;
371371 final String DAYS_PARAM = "cnt" ;
372+ final String APPID_PARAM = "APPID" ;
372373
373374 Uri builtUri = Uri .parse (FORECAST_BASE_URL ).buildUpon ()
374375 .appendQueryParameter (QUERY_PARAM , params [0 ])
375376 .appendQueryParameter (FORMAT_PARAM , format )
376377 .appendQueryParameter (UNITS_PARAM , units )
377378 .appendQueryParameter (DAYS_PARAM , Integer .toString (numDays ))
379+ .appendQueryParameter (APPID_PARAM , BuildConfig .OPEN_WEATHER_MAP_API_KEY )
378380 .build ();
379381
380382 URL url = new URL (builtUri .toString ());
You can’t perform that action at this time.
0 commit comments