Skip to content

Got the API in place and working. NOTE: it is a file note source con… #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ project.properties
##Gradle-based build
.gradle
build/
/app/src/main/res/values/API_KEY.xml
13 changes: 13 additions & 0 deletions API_KEY_____README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This app contains a file called "./app/src/main/res/values/API_KEY.xml" that is ignored by GitHub.

This file contains the API key to the open weather website service. In order for this application
to work you will need to create this file and populate with the API key given to you.

The format of the file is as contained within the lines:

----------------------------------
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="THE_OPEN_WEATHER_MAP_API_TOKEN">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</string>
</resources>
----------------------------------
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildTypes.each {
it.buildConfigField 'String', 'OPEN_WEATHER_MAP_API_KEY', MyOpenWeatherMapApiKey
}
// buildTypes.each {
// it.buildConfigField 'String', 'OPEN_WEATHER_MAP_API_KEY', MyOpenWeatherMapApiKey
// }
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void onPerformSync(Account account, Bundle extras, String authority, Cont
Uri builtUri = uriBuilder.appendQueryParameter(FORMAT_PARAM, format)
.appendQueryParameter(UNITS_PARAM, units)
.appendQueryParameter(DAYS_PARAM, Integer.toString(numDays))
.appendQueryParameter(APPID_PARAM, BuildConfig.OPEN_WEATHER_MAP_API_KEY)
.appendQueryParameter(APPID_PARAM, context.getResources().getString(R.string.THE_OPEN_WEATHER_MAP_API_TOKEN))// BuildConfig.OPEN_WEATHER_MAP_API_KEY)
.build();

URL url = new URL(builtUri.toString());
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.google.gms:google-services:1.3.0-beta1'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Apr 10 15:27:10 PDT 2013
#Wed Aug 31 11:46:39 MDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip