Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.

1.02 connect firebase to your app solution #19

Open
wants to merge 2 commits into
base: 1.00_version_0.1_start_code
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
17 changes: 16 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,23 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {

}
}

/* This for anyone following along with the repo. Since you will have a different
* root URL, this code loads up a value from your gradle.properties file.
*/

buildTypes.each {
it.buildConfigField 'String', 'UNIQUE_FIREBASE_ROOT_URL', UniqueFirebaseRootUrl
}

packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}

}

dependencies {
Expand All @@ -30,6 +43,8 @@ dependencies {
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'

compile 'com.firebase:firebase-client-android:2.4.0'

/* For Google Play Services */
compile 'com.google.android.gms:play-services-safetynet:8.3.0'
compile 'com.google.android.gms:play-services-auth:8.3.0'
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.udacity.firebase.shoppinglistplusplus">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name="com.udacity.firebase.shoppinglistplusplus.ShoppingListApplication"
android:allowBackup="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.udacity.firebase.shoppinglistplusplus;

import com.firebase.client.Firebase;

/**
* Includes one-time initialization of Firebase related code
*/
Expand All @@ -8,6 +10,8 @@ public class ShoppingListApplication extends android.app.Application {
@Override
public void onCreate() {
super.onCreate();
/* Initialize Firebase */
Firebase.setAndroidContext(this);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.udacity.firebase.shoppinglistplusplus.utils;

import com.udacity.firebase.shoppinglistplusplus.BuildConfig;

/**
* Constants class store most important strings and paths of the app
*/
Expand All @@ -19,6 +21,7 @@ public final class Constants {
/**
* Constants for Firebase URL
*/
public static final String FIREBASE_URL = BuildConfig.UNIQUE_FIREBASE_ROOT_URL;


/**
Expand Down