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

1.02 Connect Firebase to Your App - Solution #11

Open
wants to merge 1 commit into
base: 1.01_connect_firebase_to_your_app-quiz
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
14 changes: 10 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ android {
}
}

// TODO 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.
/* 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
}

// TODO Step 1: Add the packaging options here
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}

}

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

// TODO Step 1: Add the Firebase library here
compile 'com.firebase:firebase-client-android:2.4.0'

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

<!-- TODO Step 2: Add the correct app permission(s) for Firebase here -->
<uses-permission android:name="android.permission.INTERNET" />

<application
android:name="com.udacity.firebase.shoppinglistplusplus.ShoppingListApplication"
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,7 +10,8 @@ public class ShoppingListApplication extends android.app.Application {
@Override
public void onCreate() {
super.onCreate();
// TODO Step 3: Initialize Firebase
/* 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,7 +21,7 @@ public final class Constants {
/**
* Constants for Firebase URL
*/
//TODO Step 4: Set up a constant for the Firebase URL here.
public static final String FIREBASE_URL = BuildConfig.UNIQUE_FIREBASE_ROOT_URL;


/**
Expand Down