{"id":27137750,"url":"https://github.com/m4ary/firebasestorageapi","last_synced_at":"2026-05-07T10:31:24.396Z","repository":{"id":130849124,"uuid":"264312204","full_name":"m4ary/FirebaseStorageAPI","owner":"m4ary","description":" Android Library wrapper for Firebase Storage functionality.","archived":false,"fork":false,"pushed_at":"2021-06-09T06:37:51.000Z","size":2382,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-15T02:45:17.353Z","etag":null,"topics":["android","android-app","android-application","android-development","android-library","android-studio","android-ui","androidstudio","firebase","firebase-database","firebase-hosting","firebase-realtime-database","firebase-storage"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m4ary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-05-15T22:30:24.000Z","updated_at":"2021-06-09T06:37:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a396a2a-7e19-427f-87d1-5fb8e8bce32f","html_url":"https://github.com/m4ary/FirebaseStorageAPI","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/m4ary/FirebaseStorageAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4ary%2FFirebaseStorageAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4ary%2FFirebaseStorageAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4ary%2FFirebaseStorageAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4ary%2FFirebaseStorageAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m4ary","download_url":"https://codeload.github.com/m4ary/FirebaseStorageAPI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4ary%2FFirebaseStorageAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32733380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-app","android-application","android-development","android-library","android-studio","android-ui","androidstudio","firebase","firebase-database","firebase-hosting","firebase-realtime-database","firebase-storage"],"created_at":"2025-04-08T04:07:18.664Z","updated_at":"2026-05-07T10:31:24.391Z","avatar_url":"https://github.com/m4ary.png","language":"Java","funding_links":["https://www.buymeacoffee.com/mshlab"],"categories":[],"sub_categories":[],"readme":"\n# FirebaseStorageAPI [![](https://jitpack.io/v/mshlab/FirebaseStorageAPI.svg)](https://jitpack.io/#mshlab/FirebaseStorageAPI)\n\n\nFirebaseStorageAPI is an Android Library wrapper for Firebase Storage functionality.\n\u003cimg src=\"https://miro.medium.com/max/894/1*9oOH80Z7AQ9ata_8XjIIYw.gif\" alt=\"screenshot\" width=\"220\" align=\"right\"\u003e\n\n## Features\n- built-in Progress Dialog\n  - customizable messages fit your need and language  \n- Upload and download files to Firebase Storage Bucket in different forms like:\n  -  stream as an IntputStream\n  - Array of Bytes\n  - File on Device Storage\n- Delete files\n\n\n\u003cbr\u003e\n\n\n\n\n## Download\n### 1- Setup Firebase Storage \nAdd Firebase Storage library to your Firebase project\n[https://firebase.google.com/docs/storage/android/start](https://firebase.google.com/docs/storage/android/start)\n### 2-Add Gradle dependency\n- Add the following to your project level build.gradle:\n~~~\nallprojects {\n\trepositories {\n\t\t...\n\t\tmaven { url \"https://jitpack.io\" }\n\t}\n}\n~~~\n- Add this to your app build.gradle:\n~~~\ndependencies {\n...\n\t implementation 'com.github.mshlab:FirebaseStorageAPI:v1.0-release'\n}\n\n~~~\n## Usage\n1- create a FirebaseStorageAPI object\n~~~\n    FirebaseStorageAPI firebaseStorageAPI = new FirebaseStorageAPI.Builder()  \n        .setVisibleAcitivty(this) //required  \n        .build();\n~~~\n\n\n- add more custom options\n~~~ \n    firebaseStorageAPI = new FirebaseStorageAPI.Builder()  \n        .setVisibleAcitivty(this) //required  \n\t\t.setCancelMessage(\"file download canceled\") \n\t\t.setDownloadingMessage(\"downloading from the sky\")\n\t\t.setErrorMessage(\"error in gating the file, try later\") \n\t\t.setUploadingMessage(\"carrying it to cloud\")\n\t\t.setLoadingMessage(\"waiting to start\")\n\t\t.allowCancel(true) //let the user choose to cancel the download  \n\t\t.build();\n~~~\n\n2- defined a storage reference (path where you will upload or download your file) [learn how](https://firebase.google.com/docs/storage/android/create-reference)\n~~~\nStorageReference mStorageRef = FirebaseStorage.getInstance().\ngetReference().\ngetRoot().\nchild(\"pics\").\nchild(\"sky.png\");\n~~~\n**A- Upload function**\n\n1- prepare the data as :\n  - inputstream\n~~~\n InputStream DataToUpload = ...;  \n~~~\n\n  - File\n~~~\n Uri DataToUpload = Uri.fromFile(new File(\"/sdcard/hello.txt\"));\n~~~\n\n  - Bytes\n~~~\n  String string = \"helloWorldInBytes\";\n  byte[] DataToUpload=string.getBytes();\n~~~    \n2- pass it to `upload` method\n~~~\n  firebaseStorageAPI.upload(DataToUpload, mStorageRef, new OnCompleteListener() {  \n        @Override  \n  public void onComplete(@NonNull Task task) {  \n          if (task.isSuccessful()) {  \n           mStorageRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener\u003cUri\u003e() {  \n           \n            @Override  \n\t\t\tpublic void onSuccess(Uri ) {  \n       statusTextView.setText(\"file uploaded successfully\\n File URL: \" + uri.toString());  \n  }}); }} });  \n~~~\n\n**B- Download function**\n  - InputStream\n~~~\nfirebaseStorageAPI.downloadAsStream(mStorageRef, new OnCompleteListener\u003cStreamDownloadTask.TaskSnapshot\u003e() {  \n    @Override  \n  public void onComplete(@NonNull final Task\u003cStreamDownloadTask.TaskSnapshot\u003e task) {  \n       \n if (task.isComplete()) {  \n  InputStream is = task.getResult().getStream();  \n   //InputStream is ready to use  \n\t\t}  \n    }  \n});\n~~~\n\n  - File\n~~~\nFile localFile = File.createTempFile(\"images\", \"jpg\");  \nfirebaseStorageAPI.downloadToLocalPath(mStorageRef, localFile, new OnCompleteListener\u003cFileDownloadTask.TaskSnapshot\u003e() {  \n    @Override  \n  public void onComplete(@NonNull Task\u003cFileDownloadTask.TaskSnapshot\u003e task) {  \n        if (task.isComplete()) {  \n        // download is complete, do your thing with the localFile ... \n            } \n         }\n      });\n~~~\n  - Bytes\n~~~\nfirebaseStorageAPI.downloadAsBytes(mStorageRef, Long.MAX_VALUE, new OnCompleteListener\u003cbyte[]\u003e({  \n    @Override  \n  public void onComplete(@NonNull Task\u003cbyte[]\u003e task) {  \n if (task.isComplete()) {\n    byte[] dataInBytes = task.getResult();  \n\t// download complete , do your thing with the dataInBytes\n  } \n }  \n});\n~~~\n\n\n\n\n\n\n---\n## Buy me a coffee\n\u003ca href=\"https://www.buymeacoffee.com/mshlab\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/lato-orange.png\" alt=\"Buy Me A Coffee\" style=\"height: 51px !important;width: 217px !important;\" \u003e\u003c/a\u003e \n### License\n[MIT](LICENSE) © mshlab.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm4ary%2Ffirebasestorageapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm4ary%2Ffirebasestorageapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm4ary%2Ffirebasestorageapi/lists"}