Firebase Storage – Download Files to Memory, Local File | Android
firebase
35
storage
6
android
80
localfile
2
Male avatar

loveprogramming viết ngày 23/04/2021

https://grokonez.com/android/firebase-storage-download-files-to-memory-local-file-android

Firebase Storage – Download Files to Memory, Local File | Android

In previous post, we had known the way to upload data. This tutorial shows you how to download Files to Memory, Local File with Firebase Cloud Storage.

Related Post:
Firebase Storage – Upload Data from Memory, Local File, Stream | Android

More Practice:
Firebase Storage – Get List of Files example – Image List | Android

I. How to download file

To use the Firebase Storage to download file, we need:

  • add Firebase to Android App & enable Firebase Auth
  • create a reference to the full path of the file, including the file name
  • download file using getBytes() for in-memory data, getFile() for local file.

To know way to add Firebase to Android App & enable Firebase Auth, please visit previous post:
Firebase Storage – Upload Data from Memory, Local File, Stream | Android

This tutorial bases on the code from that post, and continues with download methods.

1. Create a Reference


// From our app
StorageReference storageRef = storage.getReference();

// With an initial file path and name
StorageReference pathReference = storageRef.child("images/javasampleapproach.jpg");

// To a file from a Google Cloud Storage URI
StorageReference gsReference = storage.getReferenceFromUrl("gs://javasampleapproach-storage.appspot.com/images/javasampleapproach.jpg");

// From an HTTPS URL
StorageReference httpsReference = storage.getReferenceFromUrl("https://firebasestorage.googleapis.com/v0/b/javasampleapproach-storage.appspot.com/o/images%2Fjavasampleapproach.jpg");

More at:

https://grokonez.com/android/firebase-storage-download-files-to-memory-local-file-android

Firebase Storage – Download Files to Memory, Local File | Android

Bình luận


White
{{ comment.user.name }}
Bỏ hay Hay
{{comment.like_count}}
Male avatar
{{ comment_error }}
Hủy
   

Hiển thị thử

Chỉnh sửa

Male avatar

loveprogramming

451 bài viết.
79 người follow
Kipalog
{{userFollowed ? 'Following' : 'Follow'}}
Cùng một tác giả
Male avatar
1 0
Tutorial Link: (Link) (Ảnh) Django is a Pythonbased free and opensource web framework that follows the modeltemplateview architectural pattern. A...
loveprogramming viết 6 tháng trước
1 0
Male avatar
1 0
https://loizenai.com/angular11nodejspostgresqlcrudexample/ Angular 11 Node.js PostgreSQL Crud Example (Ảnh) Tutorial: “Angular 11 Node.js Postg...
loveprogramming viết 5 tháng trước
1 0
Male avatar
1 0
Angular Spring Boot jwt Authentication Example Github https://loizenai.com/angularspringbootjwt/ (Ảnh) Tutorial: ” Angular Spring Boot jwt Authe...
loveprogramming viết 5 tháng trước
1 0
Bài viết liên quan
Male avatar
0 0
https://grokonez.com/android/firebasestoragegetlistfilesdisplayimagefirebaseuidatabaseandroid Firebase Storage – Get List of Files example – Image...
loveprogramming viết 22 ngày trước
0 0
{{like_count}}

kipalog

{{ comment_count }}

bình luận

{{liked ? "Đã kipalog" : "Kipalog"}}


Male avatar
{{userFollowed ? 'Following' : 'Follow'}}
451 bài viết.
79 người follow

 Đầu mục bài viết

Vẫn còn nữa! x

Kipalog vẫn còn rất nhiều bài viết hay và chủ đề thú vị chờ bạn khám phá!