简体   繁体   English

使用 Firebase 使用我的本地图像创建数据库

[英]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.

相关问题 如何使用毕加索将我的 Firebase 数据库中的图像放到我的 RecyclerView 上? - How can I put images on my RecyclerView from my Firebase database using Picasso? 在Firebase数据库创建二胎 - Create second child in Firebase database 通过 Firebase 功能将图片下载到用户本地机器 - Download images to users local machines via Firebase Functions 为什么我的图像没有从 firebase 火库中显示? - Why my images is not showing from firebase firestore? 为什么我的 firebase 图片没有显示在 RecyclerView 中? - Why are my firebase images not being displayed in the RecyclerView? 如何使用本地模拟器将firebase图片上传到web? - how to upload firebase images to web using local emulator? 无法从本地存储 Firebase 实时数据库中匹配孩子的孩子 - Unable to match child of a child from local storage Firebase RealTime database 如何将与产品关联的图像和文本手动上传到 firebase 数据库 - How to upload images, and text that's associated with a product to firebase database manually 为什么我的 Firebase 数据库的某些属性未定义? - Why are some properties of my Firebase database undefined? 突然丢失了我的 Firebase Firestore 数据库 - Suddenly lost my Firebase Firestore database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM