[英]Create a database with my local images with Firebase
First of all, I would like to say that I am a beginner in the development of applications and the use of firebase.首先声明一下,对于firebase的应用开发和使用,我是初学者。
I would like to create packages containing sets of vector images but I do not see in the documentation how to do it.我想创建包含矢量图像集的包,但我没有在文档中看到如何做。
Indeed, in the Realtime Database section, there is no "picture" type.事实上,在实时数据库部分,没有“图片”类型。 I saw that I could add some to the database via the storage.我看到我可以通过存储向数据库添加一些。 But again, it is only images generated for the user in the application.但同样,它只是在应用程序中为用户生成的图像。
The last option I thought of was to use the cloud functions.我想到的最后一个选择是使用云功能。 Again, I feel like I can't trigger anything without it pre-existing in the application.再一次,我觉得如果应用程序中没有它,我就无法触发任何东西。
What do you think about it?你怎么看待这件事? Can I still use Firebase to get the result I want?我仍然可以使用 Firebase 来获得我想要的结果吗?
Indeed, in the Realtime Database section, there is no "picture" type.事实上,在实时数据库部分,没有“图片”类型。
The Realtime Database is a cloud-hosted NoSQL database that lets you store and sync data between your users in real-time.实时数据库是一个云托管的 NoSQL 数据库,可让您在用户之间实时存储和同步数据。 So it's not a product that can help you store images.所以它不是一个可以帮你存储图像的产品。
I saw that I could add some to the database via the storage.我看到我可以通过存储向数据库添加一些。 But again, it is only images generated for the user in the application.但同样,它只是在应用程序中为用户生成的图像。
Yes, Firebase Cloud Storage is a service that can help you store any type of file, including vector images.是的, Firebase 云存储是一项可以帮助您存储任何类型文件的服务,包括矢量图像。 In order to be able to access those files, you need to know the URLs of the files.为了能够访问这些文件,您需要知道这些文件的 URL。 So it's best to store those URLs, either in Cloud Firestore or in the Realtime Database for later use.因此,最好将这些 URL 存储在Cloud Firestore或实时数据库中以备后用。 Since you tagged your question with Kotlin, I think that the following resource will definitely help:由于您使用 Kotlin 标记了您的问题,我认为以下资源肯定会有所帮助:
Where I have explained how you can upload a file from your local device to Cloud Storage, get the download URL, and display the image using Jetpack Compose.我已经解释了如何将文件从本地设备上传到 Cloud Storage,获取下载 URL,并使用 Jetpack Compose 显示图像。 Here is also the corresponding repo .这里也是相应的repo 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.