SlideShare ist ein Scribd-Unternehmen logo
1 von 12
FIREBASE
STORAGE
FOR ANDROID.
By Prushni Jani
Why Firebase ?
 Build apps fast, without
managing infrastructure
 One console, with products
that work together
 Backed by Google, trusted by
top apps
Cloud Storage is built for app developers who need to store
and serve user-generated content, such as photos or videos.
FIREBASE STORAGE
How does it work?
 Firebase Cloud Storage stores your files (Images or
Videos) in a Google Cloud Storage bucket.
 These files can be accessible through both Firebase and
Google Cloud.
 So developers choose firebase storage so that the
applications will be more flexible and user can upload
and download files from mobile devices. Developers
use Firebase SDKs for this.
FIREBASE STORAGE
How to implement ?
Integrate the Firebase
SDKs for Cloud Storage.
Create a Reference
Upload/Download
FIREBASE STORAGE
ImageView
Choose Upload
Lets create a project for more understanding.
For example, we want to select an image from
app and upload to Storage
FIREBASE STORAGE
1. Configure
your Project
2. Add
Reference
points
3. Code For
Uploading File
Steps for implementation :
FIREBASE STORAGE
STEP 1 : Configure your Project
1. Click on TOOLS and select FIREBASE.
2. Click on Storage. => Click on Upload and
Download
a) Click on Connect to Firebase.
b) Click on Add Firebase Dependency.
FIREBASE STORAGE
For Uploading image, we need to
add image view and two buttons.
FIREBASE STORAGE
STEP 2 : References point to files
In MainActivity.java, add
private StorageReference mStorageRef;
mStorageRef = FirebaseStorage.getInstance().getReference();
FIREBASE STORAGE
STEP 3 : Upload a File
Uri file = Uri.fromFile(new File("path/to/images/codekaksha.jpg"));
StorageReference riversRef = storageRef.child("images/rivers.jpg");
riversRef.putFile(file)
.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
// Get a URL to the uploaded content
Uri downloadUrl = taskSnapshot.getDownloadUrl();
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle unsuccessful uploads
// ...
}
});
Add this code in onClickListener of Upload Button.
FIREBASE STORAGE
You can view the files in your storage bucket in the Firebase Console.
Click on STORAGE . Go to Rules, and change the rules to :
allow read, write: if true;
Your
Uploaded
File
FIREBASE STORAGE
REFERENCES :
• Add Firebase to your Project
https://firebase.google.com/docs/android/setup
• Firebase UI
https://github.com/firebase/FirebaseUI-Android
FIREBASE STORAGE

Weitere ähnliche Inhalte

Ähnlich wie Android Firebase Storage

Firebase Auth Tutorial
Firebase Auth TutorialFirebase Auth Tutorial
Firebase Auth TutorialBukhori Aqid
 
Building with Firebase
Building with FirebaseBuilding with Firebase
Building with FirebaseMike Fowler
 
Forge - DevCon 2017, Darmstadt Germany: Integrating Forge Data Management API...
Forge - DevCon 2017, Darmstadt Germany: Integrating Forge Data Management API...Forge - DevCon 2017, Darmstadt Germany: Integrating Forge Data Management API...
Forge - DevCon 2017, Darmstadt Germany: Integrating Forge Data Management API...Autodesk
 
Spring hibernate tutorial
Spring hibernate tutorialSpring hibernate tutorial
Spring hibernate tutorialRohit Jagtap
 
Lecture 3 React Native with Database.pptx
Lecture 3 React Native with Database.pptxLecture 3 React Native with Database.pptx
Lecture 3 React Native with Database.pptxGevitaChinnaiah
 
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationAngular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationWebStackAcademy
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 Firebase overviewMaksym Davydov
 
What is new in Firebase?
What is new in Firebase?What is new in Firebase?
What is new in Firebase?Sinan Yılmaz
 
Firebase on Android: The Big Picture
Firebase on Android: The Big PictureFirebase on Android: The Big Picture
Firebase on Android: The Big PictureSriyank Siddhartha
 
Cordova Tutorial
Cordova TutorialCordova Tutorial
Cordova TutorialJacky Chen
 
Devfest SouthWest, Nigeria - Firebase
Devfest SouthWest, Nigeria - FirebaseDevfest SouthWest, Nigeria - Firebase
Devfest SouthWest, Nigeria - FirebaseMoyinoluwa Adeyemi
 
Spring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugSpring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugToshiaki Maki
 
Deploying Code In SharePoint
Deploying Code In SharePointDeploying Code In SharePoint
Deploying Code In SharePointCorey Roth
 
Features everywhere
Features everywhere Features everywhere
Features everywhere Mediacurrent
 

Ähnlich wie Android Firebase Storage (20)

Firebase Auth Tutorial
Firebase Auth TutorialFirebase Auth Tutorial
Firebase Auth Tutorial
 
Building with Firebase
Building with FirebaseBuilding with Firebase
Building with Firebase
 
Forge - DevCon 2017, Darmstadt Germany: Integrating Forge Data Management API...
Forge - DevCon 2017, Darmstadt Germany: Integrating Forge Data Management API...Forge - DevCon 2017, Darmstadt Germany: Integrating Forge Data Management API...
Forge - DevCon 2017, Darmstadt Germany: Integrating Forge Data Management API...
 
Spring hibernate tutorial
Spring hibernate tutorialSpring hibernate tutorial
Spring hibernate tutorial
 
Lecture 3 React Native with Database.pptx
Lecture 3 React Native with Database.pptxLecture 3 React Native with Database.pptx
Lecture 3 React Native with Database.pptx
 
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationAngular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase Integration
 
Firebase overview
Firebase overviewFirebase overview
Firebase overview
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 Firebase overview
 
What is new in Firebase?
What is new in Firebase?What is new in Firebase?
What is new in Firebase?
 
Firebase on Android: The Big Picture
Firebase on Android: The Big PictureFirebase on Android: The Big Picture
Firebase on Android: The Big Picture
 
Google Firebase presentation - English
Google Firebase presentation - EnglishGoogle Firebase presentation - English
Google Firebase presentation - English
 
InitiateAEv2.pdf
InitiateAEv2.pdfInitiateAEv2.pdf
InitiateAEv2.pdf
 
Cordova Tutorial
Cordova TutorialCordova Tutorial
Cordova Tutorial
 
Devfest SouthWest, Nigeria - Firebase
Devfest SouthWest, Nigeria - FirebaseDevfest SouthWest, Nigeria - Firebase
Devfest SouthWest, Nigeria - Firebase
 
Cloud Messaging Flutter
Cloud Messaging FlutterCloud Messaging Flutter
Cloud Messaging Flutter
 
Spring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugSpring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsug
 
Deploying Code In SharePoint
Deploying Code In SharePointDeploying Code In SharePoint
Deploying Code In SharePoint
 
Features everywhere
Features everywhere Features everywhere
Features everywhere
 
SPSNL - SPFx Deployment
SPSNL - SPFx DeploymentSPSNL - SPFx Deployment
SPSNL - SPFx Deployment
 
Firebase .pptx
Firebase .pptxFirebase .pptx
Firebase .pptx
 

Kürzlich hochgeladen

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Kürzlich hochgeladen (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Android Firebase Storage

  • 2. Why Firebase ?  Build apps fast, without managing infrastructure  One console, with products that work together  Backed by Google, trusted by top apps Cloud Storage is built for app developers who need to store and serve user-generated content, such as photos or videos. FIREBASE STORAGE
  • 3. How does it work?  Firebase Cloud Storage stores your files (Images or Videos) in a Google Cloud Storage bucket.  These files can be accessible through both Firebase and Google Cloud.  So developers choose firebase storage so that the applications will be more flexible and user can upload and download files from mobile devices. Developers use Firebase SDKs for this. FIREBASE STORAGE
  • 4. How to implement ? Integrate the Firebase SDKs for Cloud Storage. Create a Reference Upload/Download FIREBASE STORAGE
  • 5. ImageView Choose Upload Lets create a project for more understanding. For example, we want to select an image from app and upload to Storage FIREBASE STORAGE
  • 6. 1. Configure your Project 2. Add Reference points 3. Code For Uploading File Steps for implementation : FIREBASE STORAGE
  • 7. STEP 1 : Configure your Project 1. Click on TOOLS and select FIREBASE. 2. Click on Storage. => Click on Upload and Download a) Click on Connect to Firebase. b) Click on Add Firebase Dependency. FIREBASE STORAGE
  • 8. For Uploading image, we need to add image view and two buttons. FIREBASE STORAGE
  • 9. STEP 2 : References point to files In MainActivity.java, add private StorageReference mStorageRef; mStorageRef = FirebaseStorage.getInstance().getReference(); FIREBASE STORAGE
  • 10. STEP 3 : Upload a File Uri file = Uri.fromFile(new File("path/to/images/codekaksha.jpg")); StorageReference riversRef = storageRef.child("images/rivers.jpg"); riversRef.putFile(file) .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { // Get a URL to the uploaded content Uri downloadUrl = taskSnapshot.getDownloadUrl(); } }) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception exception) { // Handle unsuccessful uploads // ... } }); Add this code in onClickListener of Upload Button. FIREBASE STORAGE
  • 11. You can view the files in your storage bucket in the Firebase Console. Click on STORAGE . Go to Rules, and change the rules to : allow read, write: if true; Your Uploaded File FIREBASE STORAGE
  • 12. REFERENCES : • Add Firebase to your Project https://firebase.google.com/docs/android/setup • Firebase UI https://github.com/firebase/FirebaseUI-Android FIREBASE STORAGE