Storing,Viewing and Deleting List and then Sorting in Firebase

Okay I'll add the random integer then.

I'm still confused on how to implement the FirebaseStorage


I tried using it but it comes out as an error like so
noe
I'm trying to upload an image into the app for the patients profile picture, and then after clicking the register patient button, save both on the list and into the Firebase

This

image

is probably wrong.

Example:

filename = myimage1.png
path = /storage/emulated/0/Pictures/ (or /Pictures/) or without the trailing slash.

The extension may now be out of date with the filescope changes required for Android 11+

It may be easier to use the web component ?

I've looked into it but I really just want to store images from my phone to the firebase, and then get it back.

I also tried changing the file and path, and still nothing came up.


Screenshot_20230302_142934

I have never seen the path/directory Phone Storage before. if it does exist the fact that there is a space in the directory name is most probably causing the problem.

Android OS is essentially a linux framework, therefore spaces in directory and filenames should be avoided.

Phone storage means that the storage I'm taking is not in the SD card but unto the phone itself since the phone has its own storage, like in case you dont have an SD card on your device, so you use the Phone's storage itself to store stuff. This is getting a bit confusing for me to be honest. Do you have an example I can draw upon? preferably where the user picks an image wherever? SD or Phone Storage and then stores it in Firebase and be able to get it back? If not... maybe I'll just stick to TinyDB for the Image only instead

See here to understand more about "phone storage"

Of course, there is NO path
"Phone Storage/DCIM/..." in Android.
(But it might be shown on your device.)

The path should be:
/storage/emulated0/DCIM/... (absolute path) or
file:///storage/emulated0/DCIM/... (full path).

Sorry but that is the path I copied when I looked over the details of my pictures when getting its path. Could I instead modify the path to resemble the absolute path?

You can't just copy the path from your device. Use one of the paths I posted.

I've changed it but it still didnt work
Screenshot_20230303_140025
I've tried it emulated on my PC and it still came up with the same error.

Is there any example blocks I can use? If not I'll just use the TinyDB instead.

You omitted a / between emulated and 0

I dont quite understand what you mean. so should I put the path like this? /storage/emulated/0/DCIM/

Yes,if that is where the file is...

Yeah, sorry but I tried it and it still didnt work

What did you try?
Post the relevant block(s).


as mentioned by TIMAI2, to put a / between emulated and 0

and is your image file in that directory ? Your previous image of Error 1104 showed Camera/ as well ?

Also try a full path:

file:///storage/emulated/0/DCIM/
or
file:///storage/emulated/0/DCIM/Camera/

you could also try the path without the trailing /

1 Like

As I said, try also this:

1 Like

From one of my old Firebase projects:

So the path should be a full path (containing the fileName).
I didn't check it again.)

Ah, thanks, there is no error anymore, though I wonder where can I see the image now in Firebase