0% found this document useful (0 votes)
37 views2 pages

Lab 3

This document provides instructions for adding Firebase Storage and Cloud Storage capabilities to an Android app. It describes initial setup steps like adding dependencies, enabling Storage in the Firebase console, and uploading images files. It then explains how to retrieve image URLs from Storage and add them to the Realtime Database. Finally, it outlines design and coding tasks like adding an ImageView, creating a Glide module, and using Glide to display the images in the RecyclerView from the database entries. The goal is to display names, roles, and photos from the Firebase database and storage.

Uploaded by

kumar k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views2 pages

Lab 3

This document provides instructions for adding Firebase Storage and Cloud Storage capabilities to an Android app. It describes initial setup steps like adding dependencies, enabling Storage in the Firebase console, and uploading images files. It then explains how to retrieve image URLs from Storage and add them to the Realtime Database. Finally, it outlines design and coding tasks like adding an ImageView, creating a Glide module, and using Glide to display the images in the RecyclerView from the database entries. The goal is to display names, roles, and photos from the Firebase database and storage.

Uploaded by

kumar k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab 3: Firebase Storage

Initial Set-up:
1. Open your Lab 2 Project
2. Make sure you’re logged into your google account in your browser
3. Open the Firebase Assistant in Android Studio (Tools -> Firebase) and use it to add Cloud
Storage for Firebase SDK to the app
4. Open Build.gradle (Module) and add the following to dependencies:

5. Still in Build.gradle (Module) add this directly above dependencies:

Press Sync Now when you’re finished

Firebase:
6. Open console.firebase.google.com in your browser
7. Navigate to your lab project, go to the Storage section in the side bar and enable it in Test mode
8. Upload the Nadella.jpg and Jobs.jpg files in this week’s task folder to Storage
9. Click on the Jobs file after it has been uploaded, a side bar will pop up
10. Click “file location” and copy the storage location to your clipboard (you can do so by just
clicking on the link)
11. Open your Realtime Database and add the link to the database under the photo section like so
(NOTE: your links will be different, do not use these):

Design:

12. Open row_layout.xml and add an ImageView to it with the id imgPhoto


13. Set the layout_width and layout_height of the ImageView to 125dp
Coding:

14. Create a new file called MyAppGlideModule.ktl with the following code:

15. Import all the libraries by hovering over the red lines and pressing alt+enter
16. Open PersonAdapter
17. Inside MyViewHolder add a reference to the new ImageView we created with findViewById
18. Inside onBindViewHolder use Glide to display the correct Firebase photo for each database
entry

Zip your project and upload the results.


The end result should be a RecyclerView displaying all the names and roles you put inside the people
database created in Firebase last week, as well as the photos.

You might also like