0

I'm really new to Firebase and am studying how to implement it right now. I was thinking that it has functions similar to Parse where a ParseFile object can be created that holds the file and then has functions to upload it something like the following :

ParseFile parseFile = new ParseFile(file);
parseFile.saveInBackground();

If you have suggestions and/or working solutions do post them as they will be exceptionally useful.

I am also studying about RetroFit as it has a great way of sending MultiPartPost requests and if ever could be tied up with Firebase I just can't find the connection yet.

Thanks in advance!

John Ernest Guadalupe
  • 6,379
  • 11
  • 38
  • 71

1 Answers1

1

Firebase Hosting is a service for hosting static assets, typically the HTML/CSS/images of a web site. You cannot programmatically add files to Firebase Hosting.

The Firebase Database allows you to store JSON data. While binary data is not a type that is supported in JSON, it is possible to encode the binary data in say base64 and thus store the image in a (large) string. See Can I store image files in firebase using Java API? Note that while this is possible, it is not recommended for anything but small images or as a curiosity to see that it can be done.

Your best option is typically to store the images on a 3rd party image storage service.

Community
  • 1
  • 1
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • I see. Could you please recommend a service that is fast to set up and is the best for scenarios like this? I'd imagine a system whereas I'd have key-for-value storage for images - hence being able to store an image ID in Firebase and do a query in the other service to find the corresponding image – Erik Jan 29 '16 at 20:43
  • Sorry. "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam." – Frank van Puffelen Jan 29 '16 at 21:21