Firebase Study Notes-storage

Source: Internet
Author: User



Firebase Storage Official Introduction:



is built for app developers who need to store and present user-generated content, such as photos or videos. Regardless of the quality of the network, Firebase Storage can provide secure file uploads and downloads for Firebase applications. Developers can use it to store images, audio, video, or other user-generated content. Firebase Storage is supported by Google Cloud Storage, which is a powerful, simple and cost-effective object storage service.



Youku Introduction Link:http://v.youku.com/v_show/id_XMTU4Mzk2OTc2NA==.html?from=s1.8-1-1.2



Firebase Study Notes-storage



1. Login



from https://github.com/firebase/quickstart-android  clone The official demo to this machine, open the storage project in Android Studio and change the library version dependent on Build.gradle to the latest version of native support, such as Com.android.support: appcompat-v7:23.0.3 modified to com.android.support:appcompat-v7:24.0.0, and so on, the direct compilation will be error, the lack of google-service.json, to Firebase The console add app gets the corresponding JSON file copied to the app's corresponding folder and recompile the pass.



Run the code to the phone, find that clicking Sign in will crash, after viewing log, should be missing the authorized login package, add compile ' com.google.android.gms:play-services-auth in Build.gradle : 9.2.0 ', compile and run again, still unable to log in, look at the log error message is as follows:





07-04 15:59:46.525 386-386/com.google.firebase.quickstart.firebasestorage e/storage#mainactivity: Signinanonymously:failure



COM.GOOGLE.FIREBASE.FIREBASENETWORKEXCEPTION:A Network error (such as timeout, interrupted connection or unreachable hos T) has occurred.



At com.google.android.gms.internal.zzafg.zzes (Unknown Source)



At Com.google.android.gms.internal.zzafd$zzg.zza (Unknown Source)



At Com.google.android.gms.internal.zzafo.zzet (Unknown Source)



At Com.google.android.gms.internal.zzafo$zza.onfailure (Unknown Source)



At Com.google.android.gms.internal.zzafj$zza.ontransact (Unknown Source)



At Android.os.Binder.execTransact (binder.java:446)



07-04 15:59:46.555 386-386/com.google.firebase.quickstart.firebasestorage e/viewrootimpl:senduseractionevent () MView = = NULL



07-04 15:59:55.045 386-1369/com.google.firebase.quickstart.firebasestorage w/dynamitemodule:local Module Descriptor Class for Com.google.firebase.auth not found.




The key here is Signi. Nanonymously:failure, in Firebase auth support 6 kinds of login methods are Email/password,google,twitter,facebook,github,anonymous, in this demo is to use the last Anonymous way, and to support these logins, you need to set the corresponding item in the Firebase console to enable. Enter the console to locate the Sign-in method entry in the Auth entry, set the anonymous to Enable,save and re-download



2. Uploading images



Click on the upload, save the picture after taking photos with the phone to return, automatic upload success.



3. View



Enter the Firebase console click on the storage item and you will see that the photo you just took has been saved in the cloud, click any image, and you can see the picture information and the location in Google Cloud, download link, etc. in the Details section on the right.









This article from "Blue Work Study Notes" blog, please be sure to keep this source http://pisota.blog.51cto.com/3109961/1795655



Firebase Study Notes-storage


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.